[Haskell-cafe] What does "1 = 2" mean in Haskell?

Brandon Allbery allbery.b at gmail.com
Fri Feb 24 05:49:17 UTC 2017


On Fri, Feb 24, 2017 at 12:38 AM, Harendra Kumar <harendra.kumar at gmail.com>
wrote:

> In these examples, we can identify the constructor (capitalized first
> letter) on the LHS and so we are trained to know that it is a pattern
> match. The original point related to number specialness was that "1 = 2" is
> not easily identifiable as a pattern match because there are no explicit
> constructors. The literal "1" here is neither an "explicit constructor" nor
> a binding symbol.


Yes, at this point you just have to know that the Report specifies a bunch
of special handling for numeric literals.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170224/27ed52c0/attachment.html>


More information about the Haskell-Cafe mailing list