New type of ($) operator in GHC 8.0 is problematic

Boespflug, Mathieu m at tweag.io
Mon Feb 15 11:51:23 UTC 2016


> As far as I know, there is currently know way to
> do this in 7.10.
>
> Given how much backlash there has been to changing the type of ($), ...

Keep in mind... as we saw with FTP, that in this community it's often
unclear just how large or tiny a group of people represent when
they're vocal (could be an outright majority, could in fact be just a
handful... hard to tell). ;)

> I'd
> be fine not using -fshow-runtime-rep during the core library haddock
> builds. In effect the message to users would be,
>
>     "yes, unboxed types exist and they are now on sound theoretical
>     footing, but they are still largely an implementation detail, just as
>     they have always been. If you want to use them you need to know
>     where to look."

When that last sentence is expanded out a bit to explain what "know
where to look means", it means

"yes, unboxed types exist and they are now on sound theoretical
footing [...]. If you want to use them you need to know where to look,
i.e. pass -fshow-runtime-types to GHCi every time, and compile your
own Haddock's, keep them safe somewhere on your computer and point
your browser there instead, because
https://downloads.haskell.org/~ghc/latest/docs/html/libraries/ is not
going to tell you where you can use it."

All in a laudable effort to present less information to beginners
out-of-the-box, IMHO the story is starting to look awefully
complicated for Haskell practitioners, i.e.
beginners-a-little-while-ago...

Said another way, sounds to me like we're in a case of: avoiding
surprise now begets bigger surprise later (and wasted time trying to
discover all these myriad flags whose sole existence was to pretend to
her/him that things are simpler than they really are, and then dealing
with their consequences...) when the beginner becomes practitioner.

> Perhaps this can be revisited at some point in the future when we have a
> better story for a beginner's Prelude but for now I'm not sure we want
> to subject everyone to these new types.

TBH I'm fairly skeptical about the "Prelude for beginners" idea.
Things like e.g. the AMP require that everyone has the same idea of
what the definition of the Monad class is. Yet it's not like you're
either a beginner or you're not: it's a continuum (we're all
beginners, just some less than others...). When beginners start
uploading new packages on Hackage (and I hope they do), but do so
using BeginnerPrelude because that's what they were taught, then we
start having to make the (artificially created) "beginner world" and
the "real world" agree. If I define an instance of a BeginnerPrelude
class in package A, it might not be exploitable in package B. Worse,
if what we're really talking about is beginner-base, then what happens
when they both define their own Data.List module? So in the end the
scope of a BeginnerPrelude may be very limited indeed.

If a beginner Prelude is really the right way forward, then surely one
of the many authors of Haskell books would have put one forward by now
and recommend using that?

 But perhaps this is a topic for another thread...

--
Mathieu Boespflug
Founder at http://tweag.io.


More information about the ghc-devs mailing list