Getting rid of -XImpredicativeTypes

Carter Schonwald carter.schonwald at gmail.com
Sun Sep 25 18:16:31 UTC 2016


Sounds good to me. Such a change actually probably be good for reducing ghc
support load around flags that don't work and increase reasons why using
explicit type application will be awesome / more expressive than what I
would otherwise be able to do with proxy arguments


Tldr +1
A) reduces amount of community support load around unsupported flags
B) makes visible type application extension meaningfully stronger / more
powerful than proxy value approaches

On Sunday, September 25, 2016, Simon Peyton Jones via ghc-devs <
ghc-devs at haskell.org> wrote:

> Friends
>
>
>
> GHC has a flag -XImpredicativeTypes that makes a half-hearted attempt to
> support impredicative polymorphism.  But it is vestigial…. if it works,
> it’s really a fluke.  We don’t really have a systematic story here at all.
>
>
>
> I propose, therefore, to remove it entirely.  That is, if you use
> -XImpredicativeTypes, you’ll get a warning that it does nothing (ie.
> complete no-op) and you should remove it.
>
>
>
> Before I pull the trigger, does anyone think they are using it in a
> mission-critical way?
>
>
>
> Now that we have Visible Type Application there is a workaround: if you
> want to call a polymorphic function at a polymorphic type, you can
> explicitly apply it to that type.  For example:
>
>
>
> {-# LANGUAGE ImpredicativeTypes, TypeApplications, RankNTypes #-}
>
> module Vta where
>
>   f x = id @(forall a. a->a) id @Int x
>
>
>
> You can also leave out the @Int part of course.
>
>
>
> Currently we have to use -XImpredicativeTypes to allow the @(forall a.
> a->a).    Is that sensible?  Or should we allow it regardless?   I rather
> think the latter… if you have Visible Type Application (i.e.
> -XTypeApplications) then applying to a polytype is nothing special.   So I
> propose to lift that restriction.
>
>
>
> I should go through the GHC Proposals Process for this, but I’m on a
> plane, so I’m going to at least start with an email.
>
>
>
> Simon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160925/6f0fac29/attachment.html>


More information about the ghc-devs mailing list