[Haskell-cafe] New type of ($) operator in GHC 8.0 is problematic
Artyom
yom at artyom.me
Sat Feb 6 00:15:56 UTC 2016
I agree, it’s a bit too heavy. In fact, since most users probably won’t
ever ever ever need that type, let’s only impose it on those who
explicitly agree to see it:
| > :t ($) -- Note: the actual type is slightly more generic; set
-fshow-levity -- or use :t# instead of :t to see the fully generic form.
($) :: (a -> b) -> a -> b |
On 02/06/2016 03:06 AM, Mihai Maruseac wrote:
> On Fri, Feb 5, 2016 at 6:22 PM, Artyom <yom at artyom.me> wrote:
>> Why not just make GHCi output a comment whenever the type involves levity?
>>
>>> :t ($)
>> -- Note: the actual type is more generic:
>> --
>> -- ($) :: forall (w :: GHC.Types.Levity) a (b :: TYPE w). (a -> b) -> a
>> -> b
>> --
>> -- For the absolute majority of purposes the simpler type is correct.
>> -- See GHC Guide chapter X point Y to learn more about this.
>>
>> ($) :: (a -> b) -> a -> b
>>
> Wouldn't this look like a scary error to some users? Though, users can
> get accustomed to this and this solution seems to be the best of both
> worlds.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160206/eb7b687b/attachment.html>
More information about the Haskell-Cafe
mailing list