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

Oleg Grenrus oleg.grenrus at iki.fi
Sat Feb 6 19:07:01 UTC 2016


> On 06 Feb 2016, at 15:30, ghc-devs at stefan-klinger.de wrote:
> 
> Richard, thank you very much for your elaborate statement.  The
> problem I see with a `BeginnersPrelude` is that it will either
> outdate, or create a bubble escaping from which is so painful that
> most new Haskell programmers will hesitate to take the step.  GHC
> developement will carry on, more and more things being hidden behind
> `BeginnersPrelude` automatically.  We will end up educating Beginners
> that will want to stay beginners.
> 
> I'd personally wish for a `-fdefault-levity` switch, but I do not
> oversee all the consequences right now.  I know it puts load on you,
> but this actually just tells you that the language you're building
> became a bit less learnable, maybe it's good to be aware of that.
> 
> Kind regards
> Stefan

I came with maybe silly idea: What if we had a way to re-export the symbol with less-general type:

module Prelude.YourCourse (
   ($) :: (a -> b) -> a -> b,
   foldr :: (a -> b -> b) -> b -> [a] -> b,
   ...
   ) where


{-# LANGUAGE NoExplicitPrelude #-}
module Main (main) where

import Prelude.YourCourse

-- but if people need general foldr, you can:
import Prelude (foldr)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160206/7c4b12da/attachment.sig>


More information about the ghc-devs mailing list