[Haskell-beginners] where do i get wrong

Emanuel Koczwara poczta at emanuelkoczwara.pl
Sun Mar 2 19:54:13 UTC 2014


Hi,

W dniu 02.03.2014 20:24, Roelof Wobben pisze:
> Found this one:
>
> This is partly working:
>
> import Data.Char
>
> x = "aBCde".isLower
> -- Note that comments are preceded by two hyphens
> {- or enclosed
>    in curly brace/hypens pairs. -}
> main = print x
>
>
> But now I see this error:
>
>  *
>     Main.hs at 3:5-3:12
>     Couldn't match expected type `b0 -> c0' with actual type `[Char]'
>     In the first argument of `(.)', namely `"aBCde"' In the
>     expression: "aBCde" . isLower In an equation for `x': x = "aBCde"
>     . isLower
>  *
>     In an equation for `x': x = "aBCde" . isLower
>
>
> Roelof

   This expression is wrong:

     "aBCde".isLower

   You call (.) function with 2 arguments: "aBCde" and isLower. This 
doesn't make sense for the compiler (type checker).

Regards,
Emanuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140302/64e85b92/attachment-0001.html>


More information about the Beginners mailing list