[Haskell-beginners] type vs data, again...

Andres Löh andres at well-typed.com
Sun Mar 17 14:51:31 CET 2013


Hi again.

>  thank you for the tip! It helps but it's not quite there yet. If you see
> the program in attachment, I can make it compile only by commenting the type
> declaration for the second function, otherwise it's the exact same error
> message as before.

You're probably using the wrong HashMap. There are several packages on
Hackage implementing similarly-named data structures (which is
confusing, I know, but such is life in a decentralized and open
world). You should use what aeson is using (because that's the library
defining the Object type synonym).

Looking at the import list of

http://hackage.haskell.org/packages/archive/aeson/0.6.0.2/doc/html/src/Data-Aeson-Types-Internal.html

we see

import Data.HashMap.Strict (HashMap)

and by checking the package dependencies of aeson, we figure out that
this module is provided by the unordered-containers package.

Cheers,
  Andres

-- 
Andres Löh, Haskell Consultant
Well-Typed LLP, http://www.well-typed.com



More information about the Beginners mailing list