[Haskell-cafe] Function and pattern bindings

Adam Bergmark adam at bergmark.nl
Sun Aug 14 13:39:32 UTC 2016


Hi James,

I think the difference they want to convey is that a function binding names
an identifier and can contain several patterns, e.g. `foo [x] y = x + y`
whereas a pattern binding is just one pattern, e.g. `[x]` or `y` in the
earlier example. Function bindings can be desugared to case expressions
with patterns.

Adam


On Sun, Aug 14, 2016 at 3:32 PM, James Brown <james.brown5374 at gmail.com>
wrote:

> I am reading Haskell report 2010 and I can't understand the differences
> between function bindings and pattern bindings. Can anyone explain the
> differences?
>
> ​​​​​​​
>
> _______________________________________________
> 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/20160814/83470016/attachment.html>


More information about the Haskell-Cafe mailing list