containers icon indicating copy to clipboard operation
containers copied to clipboard

IntMap does break the` read.show inverse rule`

Open andrewufrank opened this issue 3 years ago • 1 comments

I am not experienced with using specialized containers. I work on code written by others and observe that I cannot read successfully an output produced with show.

The gist of the error message is (with import qualified Data.IntMap.Strict as IM

    • Couldn't match type ‘InsOrdHashMap k5 [a2]’
                     with ‘IM.IntMap [Double]’
      Expected type: IndexMap [Double]
        Actual type: InsOrdHashMap k5 [a2]
    • In the ‘_vertices'’ field of a record

In the code I find fromList which seem not to be resolved to the correct list type.

I cannot see how to import Data.IntMap.Strict, given that other fromList occur in the same code. Is there a solution?

andrewufrank avatar Jul 30 '22 09:07 andrewufrank

Your error message mentions InsOrdHashMap and IndexMap, neither of which are from containers. If read . show was really broken, you'd see a runtime error, not a compile error, so your problem lies somewhere else.

konsumlamm avatar Jul 30 '22 09:07 konsumlamm

Thank you for clarification. As I mentioned, I am not experienced with the package and did not draw the correct conclusions from the error message.

andrewufrank avatar Aug 20 '22 20:08 andrewufrank