haskell - fmap (+1) $ read "[1]" gives error -


when type repl fmap (+1) $ read "[1]" expect [2] instead error :

no instance (functor f0) arising use of ‘it’

unfortunately doesn't me. explain me wrong snipped of code.

it doesn't know type read value into. specifying type explicitly:

fmap (+1) $ (read "[1]" :: [int]) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -