[Haskell-cafe] New type of ($) operator in GHC 8.0 is problematic

Ben Gamari ben at smart-cactus.org
Sat Feb 6 13:30:03 UTC 2016


Tom Ellis <tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> writes:

> On Sat, Feb 06, 2016 at 01:27:00PM +0100, Ben Gamari wrote:
>> 
>> The first (albeit rather unconvincing) example I can think of is be
>> something like,
>> 
>>     getI# :: Int -> Int#
>>     getI# (I# n#) = n#
>> 
>>     n# :: Int#
>>     n# = getI# $ 5 + 8
>> 
>> Richard likely has something a bit less contrived though.
>
> I hope there's something less contrived, because if the benefit is "you get
> to use $ to apply functions whose return type is not of kind *" then the
> power to weight ratio of this is extremely low.
>
> Is it also something to do with the special treatment that $ gets in the
> compiler, to allow 'runST $ do'? 
>
>     https://www.mail-archive.com/glasgow-haskell-users@haskell.org/msg18923.html
>
To this the best of my knowledge, no. This would require impredicative polymorphism which
Richard's work does not provide. There is (was?), however, active work on this
front as well [1].

Cheers,

- Ben


[1] https://ghc.haskell.org/trac/ghc/wiki/ImpredicativePolymorphism/Impredicative-2015
-------------- 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/haskell-cafe/attachments/20160206/422e04c3/attachment.sig>


More information about the Haskell-Cafe mailing list