[GHC] #10122: PolyKinds: inferred type not as polymorphic as possible

GHC ghc-devs at haskell.org
Fri Feb 27 19:49:34 UTC 2015


#10122: PolyKinds: inferred type not as polymorphic as possible
-------------------------------------+-------------------------------------
        Reporter:  thomie            |                   Owner:
            Type:  bug               |                  Status:  closed
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1-rc2
      Resolution:  invalid           |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Thanks, you're right. I indeed did not set `-XPolyKinds` in GHCi, and
 didn't fully appreciate the difference between the types of `f1` and `f2`:

 {{{
     f1 :: (forall          (a::k) (m::k->*). m a -> Int) -> Int
     f2 :: (forall (k::BOX) (a::k) (m::k->*). m a -> Int) -> Int
 }}}

 I asked a stackoverflow [http://stackoverflow.com/questions/28772695
 /rankntypes-and-polykinds question] about this, so that the answer will be
 easier to find.

 Possible documentation improvements:
 * an explanation or link to an explanation for `BOX` is missing (see
 'Datatype promotion').
 * the documentation shows the initial `forall (k:BOX)` in `f1`'s type, but
 GHCi and GHC error message leave it out. This could be made more clear.
 * the inferred type signatures show `:` instead of `::`, unnecessarily.
 * maybe add one more sentence about the implications the placement of the
 `kind forall`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10122#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list