[Haskell-cafe] Documenting extensions
doug at cs.dartmouth.edu
Tue Apr 5 20:12:15 UTC 2016
I'd like to believe the Haskell report is a bible. I learned H98
using the Prelude as a source of examples and Hugs as a testbed. That
was a comfortable and rewarding combination. Later I discovered
that by default GHC rejected almost all my report-conforming (H98
and H2010) code. Ironically, its website at the time asserted,
"Haskell is a standard language."
In fact, far from reflecting biblical authority, the de facto Haskell
discussed in this cafe comes in some 2^99 flavors -- enough to use
a different language for every run of the compiler for the life of
the universe. Witness:
ghc --supported-languages | grep -v '^No[A-Z]' | wc -l
(99 is the answer for GHC 7.8.4. In fact not all combinations of
-X options are legal, but you get the point.)
Unfortunately there is no coherent discussion of all those Haskells.
The extensions section of the GHC User Guide gives no formal syntax,
often teaches semantics only by example, and is replete with sales
pitches, partial analogies, inconsistent terminology, and (helpful)
appeals to outside sources. Definitely not a bible.
I understand that many GHC extensions are probationary. Nevertheless,
in the interest of facilitating their full and correct use, I would
plead that a report-grade description accompany each language feature
incorporated in official releases. This seems like a small amount
of effort beyond the hard work of conception and implementation.
Are there cogent reasons for doing otherwise?
More information about the Haskell-Cafe