[Haskell-cafe] type error

Cetin Sert cetin.sert at gmail.com
Thu Dec 11 01:49:33 EST 2008


Why does this not function?

Prelude> sequence [print 'a', print 2]
*Prelude> let myprint = print*
*Prelude> sequence [myprint 'a', myprint 2]*

    Couldn't match expected type `()' against inferred type `Char'
    In the first argument of `myprint', namely 'a'
    In the expression: myprint 'a'
    In the first argument of `sequence', namely
        `[myprint 'a', myprint 2]'

Can providing some type annotations (interactively in ghci or in some .hs
file) help solve the problem?

Best Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081211/d2d31379/attachment.htm

More information about the Haskell-Cafe mailing list