Hi, I'm trying to run an example from the eason documentation:
λ> do result <- decode "{\"name\":\"Dave\",\"age\":2}"
flip parseMaybe result $ \obj -> do
age <- obj .: "age"
name <- obj .: "name"
return (name ++ ": " ++ show (age*2))
I made a function:
jsonTest = do
result <- decode "{\"name\":\"Dave\",\"age\":2}"
flip parseMaybe result $ \obj -> do
age <- obj .: "age"
name <- obj .: "name"
return (name ++ ": " ++ show (age*2))
which can not compile:
hh.hs:35:41:
No instance for (Show a0) arising from a use of ‘show’
The type variable ‘a0’ is ambiguous
....
...
Please what am I doing wrong?
Cheers, Miro