Commit 5334fa65 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Template Haskell: Using kinds

parent b9328630
......@@ -16,6 +16,6 @@ genAnyClass name decls
= DataD [] anyName [] [constructor] []
where
anyName = mkName ("Any" ++ nameBase name ++ "1111")
constructor = ForallC [var_a] [ClassP name [VarT var_a]] $
constructor = ForallC [PlainTV var_a] [ClassP name [VarT var_a]] $
NormalC anyName [(NotStrict, VarT var_a)]
var_a = mkName "a"
......@@ -13,3 +13,9 @@ $( [d| type instance S Int = Bool |] )
bar :: S Int -> Int
bar c = if c then 1 else 2
$( [d| type family R (a :: * -> *) :: * -> * |] )
$( [d| type instance R Maybe = [] |] )
baz :: R Maybe Int -> Int
baz = head
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment