Language complexity & beginners (Was: New type of ($) operator in GHC 8.0 is problematic)

Roman Cheplyaka roma at ro-che.info
Sat Feb 6 14:55:56 UTC 2016


On 02/06/2016 02:09 AM, Richard Eisenberg wrote:
> The old type of ($) was always a lie. -XMagicHash just changes the
> parser, allowing the # suffix. It is only by convention that most (all?)
> unlifted things end in #. The old type of ($) was perhaps a harmless
> lie, but a lie nonetheless.
> 
> Are we comfortable with lying? (Believe me, I'm not trying to impose
> some moral dimension to simplifying output!) In my mind, lying about
> types like this is in the same space as having a beginner's Prelude. And
> people will constantly discover that we're lying and get very confused.
> Having a whole host of flags that tell GHC to lie less is somewhat like
> having two versions of the language... only the differences manifest
> only in output instead of input.
> 
> If we are comfortable with lying in this way: as I've offered, I can
> hide the type of ($) (and other representation-polymorphic things)
> behind a flag. Easy to do.

I would call this a simplification rather than a lie.

When in physics we model a falling ball, we normally do not factor in
quantum or relativistic effects. Not only would that complicate the
calculations immensely, but also make very little difference on the
outcome. That applies equally to a high-school physics student and to an
engineer.

Likewise, /usually/ when we program in Haskell, we do not care about
levity polymorphism. If levity stuff pops up in ghci, that would only
clutter the output and obscure the important bits, for beginners and
experienced users alike.

So yes, please do hide the representation-polymorphic artifacts behind a
flag, perhaps with a warning whenever something is concealed.

But despite all the negativity in this thread, I want to say that your
work on this and other aspects of GHC is very much appreciated. Keep it up!

Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160206/44cc648d/attachment.sig>


More information about the ghc-devs mailing list