Skip to content

Instantly share code, notes, and snippets.

@gallais
Created June 17, 2015 15:22
Show Gist options
  • Save gallais/05d2d021236e92d9030b to your computer and use it in GitHub Desktop.
Save gallais/05d2d021236e92d9030b to your computer and use it in GitHub Desktop.
Only GADTs can be partially applied.
data Extend' (r :: Nat -> *) (t :: *) (n :: Nat) where
Here :: t -> Extend' r t Zero
There :: r n -> Extend' r t (Succ n)
type family Extend (r :: Nat -> *) (t :: *) (n :: Nat) where
Extend r t Zero = t
Extend r t (Succ n) = r n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment