New type of ($) operator in GHC 8.0 is problematic
ben at smart-cactus.org
Mon Feb 15 10:52:58 UTC 2016
"Boespflug, Mathieu" <m at tweag.io> writes:
> Hi Ben,
> thanks for the nice summary. I haven't been following all the details
> in the meanderings of this thread, but perhaps someone can chime in
> with an answer to this simple question:
> * has it been discussed what type ($) should have in the Haddock's for
> base? If so, will it the one GHCi shows by default, or the one GHCi
> will show when -fshow-runtime-rep?
> If the former, how is a user supposed to discover that ($) is in fact
> more general than what the docs would tell you?
> If the latter, wouldn't the Haddock's be just as confusing to
> beginners as GHCi's output currently is? Wouldn't it be even more
> confusing that the Haddock's and GHCi don't agree about what the type
> of ($) really is?
Indeed, the disagreement is confusing, but we have been living with this
confusion for quite some time now as ($) is already open-kinded. If
nothing else, this new state of affairs is slightly better since if you
know the secret -fshow-runtime-rep incantation you can convince GHCi to
tell you the real type. 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 ($), 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."
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.
Anyways, this is just my two cents. It would be nice to hear what others
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 472 bytes
Desc: not available
More information about the ghc-devs