Extensions to Haskell 98 in the GHC Prelude?

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 https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.9.0.0/P... 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 https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html#ha... 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. Thanks, Dylan Thurston

On 24 February 2017 at 02:59, Dylan Thurston
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
https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.9.0.0/P...
but it's not picked out as something non-standard.
Do you mean that it's now in the Prelude as opposed to being in a different module? If so, that came through from the Applicative => Monad Proposal (aka AMP): https://wiki.haskell.org/Functor-Applicative-Monad_Proposal There's also the GHC migration guide that might be helpful: https://ghc.haskell.org/trac/ghc/wiki/Migration
I didn't find it documented where I would have expected in the GHC docs at
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html#ha...
Yes, that's a little odd.
nor did I see a way to get a standards-compliant prelude?
There's the haskell2010 (and also a haskell98) package: http://hackage.haskell.org/package/haskell2010 I'm not sure how well it works now though; AMP appears to have broken it: https://ghc.haskell.org/trac/ghc/ticket/9590 -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

On Thu, Feb 23, 2017 at 6:31 PM, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
I'm not sure how well it works now though; AMP appears to have broken it: https://ghc.haskell.org/trac/ghc/ticket/9590
Didn't the removal of Show and Eq "superclasses" of Num break it? -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On 24 February 2017 at 10:38, Brandon Allbery
On Thu, Feb 23, 2017 at 6:31 PM, Ivan Lazar Miljenovic
wrote: I'm not sure how well it works now though; AMP appears to have broken it: https://ghc.haskell.org/trac/ghc/ticket/9590
Didn't the removal of Show and Eq "superclasses" of Num break it?
Right, I forgot about that one. So AMP just smashed it for good measure :p -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com

GHC consciously varies from the existing language standard in a number of
ways.
Most of the variances are in things like parsing or typechecking corner
cases.
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
https://downloads.haskell.org/~ghc/master/users-guide/bugs.html
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.
-Edward
On Thu, Feb 23, 2017 at 10:59 AM, Dylan Thurston
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
https://downloads.haskell.org/~ghc/latest/docs/html/ libraries/base-4.9.0.0/Prelude.html
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
https://downloads.haskell.org/~ghc/latest/docs/html/users_ guide/bugs.html#haskell-standards-vs-glasgow-haskell- language-non-compliance
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.
Thanks, Dylan Thurston _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (4)
-
Brandon Allbery
-
Dylan Thurston
-
Edward Kmett
-
Ivan Lazar Miljenovic