[Haskell-beginners] $ versus .

Lawrence Bottorff borgauf at gmail.com
Mon Jan 25 18:16:05 UTC 2021


I've got this

> init $ tail [1,2,3]
[2]

and this

> chopEnds = init $ tail
> chopEnds [1,2,3]
[1,2]

What happened? Why is it not just init $ tail [1,2,3] ?

This works fine

> chopEnds2 = init . tail
> chopEnds2 [1,2,3]
[2]

What am I missing?

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20210125/885f5850/attachment.html>


More information about the Beginners mailing list