[Haskell-cafe] Just 3 >>= (1+)?
thestonetable at gmail.com
Sat May 9 20:00:29 EDT 2009
... There have been 12 replies to this question, all of which say the
same thing. I'm glad we're so happy to help, but does
Just 3 >>= return . (+1)
Need to be explained by 12 different people?
fmap ("trying to"++) $ Just "help" -- :D
>> Why doesn't this work?
>> [michael at localhost ~]$ ghci
>> GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
>> Loading package ghc-prim ... linking ... done.
>> Loading package integer ... linking ... done.
>> Loading package base ... linking ... done.
>> Prelude> Just 3 >>= (1+)
>> No instance for (Num (Maybe b))
>> arising from a use of `it' at <interactive>:1:0-14
>> Possible fix: add an instance declaration for (Num (Maybe b))
>> In the first argument of `print', namely `it'
>> In a stmt of a 'do' expression: print it
More information about the Haskell-Cafe