blob: b6c52be15b929a1bf8a1560d93c516a054ad0b1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE DataKinds, GADTs, PolyKinds, RankNTypes, TypeOperators, TypeFamilies
, TypeApplications, TypeInType #-}
module DumpParsedAst where
import Data.Kind
data Peano = Zero | Succ Peano
type family Length (as :: [k]) :: Peano where
Length (a : as) = Succ (Length as)
Length '[] = Zero
-- vis kind app
data T f (a :: k) = MkT (f a)
type family F1 (a :: k) (f :: k -> Type) :: Type where
F1 @Peano a f = T @Peano f a
data family Nat :: k -> k -> Type
newtype instance Nat (a :: k -> Type) :: (k -> Type) -> Type where
Nat :: (forall xx. f xx -> g xx) -> Nat f g
main = putStrLn "hello"
|