[Haskell-cafe] Just 3 >>= (1+)?
miguelimo38 at yandex.ru
Sun May 10 04:16:11 EDT 2009
On 10 May 2009, at 04:00, Cory Knapp wrote:
> ... There have been 12 replies to this question, all of which say
> the same thing.
Brandon's one was different. And incorrect, which shows that this
question isn't completely obvious.
> I'm glad we're so happy to help, but does
> Just 3 >>= return . (+1)
> Need to be explained by 12 different people?
1) That's how mail lists work.
2) We are just happy that Michael finally managed to present code
which passes the syntax checker. To Michael: no sarcasm here.
> 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
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe