Skip to content

Cannot use higher-rank kinds with type families

This ticket came out of a discussion with Richard in this mailing list post: https://mail.haskell.org/pipermail/haskell-cafe/2016-March/123462.html

Here's the code that should work, but doesn't:

import Data.Kind

data TyFun :: * -> * -> *
type a ~> b = TyFun a b -> *

type family (f :: a ~> b) @@ (x :: a) :: b

data Null a = Nullable a | NotNullable a

type family ((f :: b ~> c)  (g :: a ~> b)) (x :: a) :: c where
  (f  g) x = f @@ (g @@ x)

type family BaseType (k :: forall a. a ~> Type) (x :: b) :: Type where   -- this fails :(
--  BaseType k x = (@@) k x
Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information