[Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude?
ekmett at gmail.com
Fri Feb 24 05:52:57 UTC 2017
GHC consciously varies from the existing language standard in a number of
Most of the variances are in things like parsing or typechecking corner
The classes Num, Bits, Read, Floating all have variations from the existing
standard to fix stuff a very slow moving standard just never seems to get
around to fixing or for practical performance concerns.
Applicative as a superclass of Monad and generalizing the Prelude to
Foldable/Traversable are the most egregious such examples.
What you're looking for* should* be included in
Alas, a sub-section describing the AMP and Foldable/Traversable changes as
a variation on the report appears to be missing.
It isn't unique in this regard. Floating has some new members for avoiding
precision loss when exponentiating and taking logs, as well. This is also
missing. (We go out of our way to call out the extra Read members in there
after all.) For consistency (<$) being in Functor maybe should be called
out as well?
It seems there are two calls to action and a decision to make here:
1.) We should definitely do a better job of keeping the infelicities
section of the documentation up to date. Adding notes on the
Applicative/Monad changes, Foldable/Traversable changes, the incorporation
of Monoid. Adding the variation in the Floating class member list..
2.) We're fixing the language standard. A Haskell Prime committee has been
formed to this (and other) ends. My understanding from talking with Herbert
is that the current process delegates responsibility for the library
portion of the upcoming report to the core libraries committee, so we have
some language to draft.
Finally, we just need to decide if having the section in the documentation
where it is is enough, or if it needs some kind of better linkage.
On Thu, Feb 23, 2017 at 10:59 AM, Dylan Thurston <dpt at bostoncoop.net> wrote:
> Pardon me if this is a stupid/frequently asked question...
> The GHC Prelude has some extensions to the Prelude in Haskell 98 or
> Haskell 2010. For instance, it has the Applicative type class, whose
> bindings overlap with some old code of mine. Where are these
> non-standard extensions documented? The Applicative class is
> documented at
> but it's not picked out as something non-standard.
> I didn't find it documented where I would have expected in the GHC docs at
> nor did I see a way to get a standards-compliant prelude?
> In this particular case I'll probably rework my code, as Applicative
> seems like a reasonable core addition. (I am a little annoyed that it
> uses so many short infix operators; I was using (*>).) I'm just
> surprised not to see it documented anywhere.
> Dylan Thurston
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe