Skip to content

Instantly share code, notes, and snippets.

@possiblywrong
Created July 1, 2014 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save possiblywrong/a3937bb4224352c2805f to your computer and use it in GitHub Desktop.
Save possiblywrong/a3937bb4224352c2805f to your computer and use it in GitHub Desktop.
GADT unification
data Container :: * -> * -> * where
-- Some other cases go here
Map :: (a -> b) -> Container b v -> Container a v
-- Think a map type, k to v
combine :: (v -> v -> v) -> Container k v -> Container k v -> Container k v
combine c (Map f ct1) (Map g ct2) = Map f $ combine c ct1 ct2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment