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
Post a Comment