[Haskell-cafe] Rewrite without parenthesis
Daniel Berecz
daniel.Berecz at gmail.com
Thu Aug 18 12:31:57 UTC 2016
Hi,
Do you want to apply tail and then head on the list?
If so, you can write:
head $ tail [1, 2, 3]
Besides the dollar opeartor there is a dot (.) operator. You can read more
here:
http://stackoverflow.com/questions/940382/haskell-difference-between-dot-and-dollar-sign
Regards,
Daniel
On Thu, Aug 18, 2016 at 2:19 PM Francesco Ariis <fa-ml at ariis.it> wrote:
> On Thu, Aug 18, 2016 at 05:03:21AM -0700, Carl Petersen wrote:
> > How do you rewrite head (tail [1,2,3]) without parenthesis.
>
> Hello Carl, simply
>
> λ> tail [1,2,3]
> [2,3]
>
> will do! Haskell is not a Lisp, no need to wrap expressions
> around ().
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160818/50eaf784/attachment.html>
More information about the Haskell-Cafe
mailing list