Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  IO operations (鲍凯文)


----------------------------------------------------------------------

Message: 1
Date: Thu, 13 Aug 2020 18:23:02 -0700
From: 鲍凯文 <traqueofzi...@gmail.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] IO operations
Message-ID:
        <camjcg+etzehz66ep0axqxa4ygslx-g9n89m7mcc_g7604yj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

> * Couldn't match expected type `t0 Char' with actual type `Char'
> * In the second argument of `elem', namely `x'
>   In the second argument of `($)', namely '-' `elem` x
>   In the expression: not $ '-' `elem` x

Hope the other answers helped. FWIW, just wanted to point out that for me
these kinds of error messages sometimes used to be confusing since the type
of `elem` is `(Foldable t, Eq a) => a -> t a -> Bool`, so the typechecker
tells you it wants to unify `t0 Char` (where `t0` is something `Foldable`)
with `Char`. As Mr. Klink wrote, it looks like you wanted `t0` to be `[]`;
I used to get confused since I was only working with lists and the extra
`Foldable` genericity made it harder to see that I was still just working
with lists.

Best,

toz

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20200813/fc5ac250/attachment-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 146, Issue 5
*****************************************

Reply via email to