[Haskell-beginners] Trying to understand the foldl type?

Kim-Ee Yeoh ky3 at atamo.com
Tue Dec 24 15:21:52 UTC 2013


On Tue, Dec 24, 2013 at 8:19 PM, Angus Comber <anguscomber at gmail.com> wrote:

> foldl :: (a -> b -> a) -> a -> [b] -> a
>
> Eg I might do something like this:
>
> foldl (+) 0 [1..10]
>

Try the following in ghci to see if you get an idea of what's going on:

:t foldl

:t foldl (+)

:t foldl (+) 0

:t foldl (+) 0 [1..10]

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20131224/3ab952d4/attachment.html>


More information about the Beginners mailing list