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

Jeff Clites jclites at mac.com
Fri Feb 24 05:55:20 UTC 2017


> On Feb 23, 2017, at 9:49 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> 
>> 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.

Also:  "day" = "night"

Isn't every "=" a pattern match?

JEff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170223/1852aa4e/attachment.html>


More information about the Haskell-Cafe mailing list