1{-# LANGUAGE GADTs #-}
2
3data FreePro r c a b where
4  ID        :: FreePro r c x x
5  Comp      :: FreePro r c x y -> FreePro r c y z -> FreePro r c x z
6  Copy      :: FreePro r c x (x, x)
7  Consume   :: FreePro r c x ()
8  Swap      :: FreePro r c (a, b) (b, a)
9  SwapE     :: FreePro r c (Either a b) (Either b a)
10  Fst       :: FreePro r c (a, b) a
11  Snd       :: FreePro r c (a, b) b
12  InjectL   :: FreePro r c a (Either a b)
13  InjectR   :: FreePro r c b (Either a b)
14  Unify     :: FreePro r c (Either a a) a
15  First     :: FreePro r c a b -> FreePro r c (a, m) (b, m)
16  Second    :: FreePro r c a b -> FreePro r c (m, a) (m, b)
17  Alongside :: FreePro r c a b -> FreePro r c a' b' -> FreePro r c (a, a') (b, b')
18  Fanout    :: FreePro r c a b -> FreePro r c a b' -> FreePro r c a (b, b')
19  Left'     :: FreePro r c a b -> FreePro r c (Either a x) (Either b x)
20  Right'    :: FreePro r c a b -> FreePro r c (Either x a) (Either x b)
21  EitherOf  :: FreePro r c a b -> FreePro r c a' b' -> FreePro r c (Either a a') (Either b b')
22  Fanin     :: FreePro r c a b -> FreePro r c a' b -> FreePro r c (Either a a') b
23  LiftC     :: c a b -> FreePro r c a b
24  Zero      :: FreePro r c x y
25  Plus      :: FreePro r c x y -> FreePro r c x y -> FreePro r c x y
26  Unleft    :: FreePro r c (Either a d) (Either b d) -> FreePro r c a b
27  Unright   :: FreePro r c (Either d a) (Either d b) -> FreePro r c a b
28
29
30cthulhu :: FreePro r c a b -> FreePro r c a b
31cthulhu fp = _
32