goldfirere / ghc

Mirror of ghc repository. DO NOT SUBMIT PULL REQUESTS HERE
http://www.haskell.org/ghc/
Other
24 stars 1 forks source link

Failure to generalize kind in type synonym #50

Open goldfirere opened 9 years ago

goldfirere commented 9 years ago
{-# LANGUAGE PolyKinds, DataKinds, GADTs, TypeOperators,
             RankNTypes, MultiParamTypeClasses, ConstraintKinds #-}

module Typeable where

data (a :: k1) :~: (b :: k2) where
  Refl :: forall k (a :: k). a :~: a

class EqT (t1 :: k1 -> *) (t2 :: k2 -> *) where
  eqT :: t1 a -> t2 b -> Maybe (a :~: b)

type EqT' (t :: forall k. k -> *) = EqT t t

yields (with -ddump-tc)

  type EqT' (t :: forall k. k -> *) =
    EqT
      (GHC.Prim.Any *)
      (GHC.Prim.Any *)
      (t (GHC.Prim.Any *))
      (t (GHC.Prim.Any *))

That should be generalized.