[Haskell-beginners] Problem with typeclass

Stephen Tetley stephen.tetley at gmail.com
Sun Jun 20 06:03:02 EDT 2010


Hello Sebastien

Try

> (fromJValue (JBool True)) :: Bool


Or

> (fromJValue (JBool True)) :: JValue

The class function /fromJValue/ is polymorphic on its answer, so you
need to tell GHC / GHCi what type the answer will be. GHC can't infer
it because it could be more than one type.

Best wishes

Stephen


More information about the Beginners mailing list