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

Joachim Breitner mail at
Wed Feb 17 08:22:27 UTC 2016


Am Mittwoch, den 17.02.2016, 10:05 +1100 schrieb Manuel M T Chakravarty:
> * Be careful in designing your exercises/assignments (esp early
> ones), to make it unlikely for students to run into class related 
> errors.

have you, or someone else, considered or tried to simply have students
start with their own list data type, i.e.

    data List a = Nil | Cons a (List a)

and have them implement the combinators they need themselves? Of
course, you’d have to tell them to use names that do not clash with
Prelude-exported, but this would avoid Foldable et. al. and be more
educational (at the expense of maybe a slower progress, and not having
nice syntax).

Similarly, one could teach them about the non-magicness of $ and side-
step the issue with $ by having them write 

    ($$)   :: (a -> b) -> a -> b
    f $$ x =  f x
    infixr 0  $

(or whatever symbol they fancy).

This would be akin to using a beginner’s prelude, only that the
students would be writing it themselves, which IMHO is a big difference
from an educational point of view.


Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  XMPP: nomeata at • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nomeata at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the ghc-devs mailing list