[Haskell-beginners] Exercise 7.2a

trent shipley trent.shipley at gmail.com
Wed Aug 15 17:58:15 UTC 2018


That helps IMMENSELY!

I shall see if there is errata on the book's web presence.

Thanks,

Trent.

On Wed, Aug 15, 2018 at 10:22 AM Francesco Ariis <fa-ml at ariis.it> wrote:

> Hello Trent,
>
> On Wed, Aug 15, 2018 at 10:08:29AM -0700, trent shipley wrote:
> > Also, at this point I am having trouble reading these function
> declarations.
> >
> > all :: (a -> Bool) -> [Bool] -> Bool
> > all b ls = and (map b ls)
>
> There must be a typo in the text. The correct signature is
>
>     all :: (a -> Bool) -> [a] -> Bool
>
> Which is logical:
>     - we take a list of `a`s (`[a]`)
>     - we pass them through a function `a -> Bool`,
>       obtaining `[Bool]`
>     - we check if the resulting list is all comprised of `True`s.
>
> Does that help?
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20180815/987c71e2/attachment-0001.html>


More information about the Beginners mailing list