Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An obscure corner of the Haskell Report

Tags:

syntax

haskell

Section 5.2 of the Haskell 2010 Report deals with module export lists. At one point, it says:

Entities in an export list may be named as follows:

  1. A value, field name, or class method, whether declared in the module body or imported, may be named by giving the name of the value as a qvarid, which must be in scope. Operators should be enclosed in parentheses to turn them into qvarids.

...

But, uh... am I missing something? Because according to the Syntax Reference in Chapter 10:

qvarid → [ monid . ] varid

varid → ( small { small | large | digit | ' })

So in which universe does putting an operator in brackets turn it into a qvarid? It looks to me like an operator is clearly a varsym (or maybe qvarsym).

Does anybody know what's going on here? I mean, clearly Haskell definitely supports writing operators in an export list, but the syntax description in the Report doesn't appear to make sense...

like image 623
MathematicalOrchid Avatar asked Aug 16 '15 09:08

MathematicalOrchid


1 Answers

Wait, hold up... According to the Control-Free Syntax given in section 10.5:

export → qvar | qtycon ... | qtycls ... | module monid

...

varvarid | ( varsym )

qvarqvarid | ( qvarsym )

So it seems that it's not a qvarid, it's supposed to be a qvar. So it's just a typo, I guess? Is there a process for having such things fixed in the official report?

like image 166
MathematicalOrchid Avatar answered Sep 25 '22 12:09

MathematicalOrchid