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

Ben Gamari ben at smart-cactus.org
Thu Feb 4 20:26:02 UTC 2016


Christopher Allen <cma at bitemyapp.com> writes:

> My understanding was that the implicitly polymorphic levity, did (->) not
> change because it's a type constructor?
>
> Prelude> :info (->)
> data (->) a b -- Defined in ‘GHC.Prim’
> Prelude> :k (->)
> (->) :: * -> * -> *
>
> Basically I'm asking why ($) changed and (->) did not when (->) had similar
> properties WRT * and #.
>
Yes, there is a bit of an inconsistency here. As far as I understand
there is still a bit of magic around (->), which allows it to be more
polymorphic than it appears. There's a bit of evidence of this magic
here [1].

Cheers,

- Ben

[1] https://github.com/ghc/ghc/blob/84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca/compiler/prelude/TysPrim.hs#L262
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160204/d1312f80/attachment.sig>


More information about the ghc-devs mailing list