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 ID = _w0 32cthulhu (Comp fp' fp_rcyb) = _w1 33cthulhu Copy = _w2 34cthulhu Consume = _w3 35cthulhu Swap = _w4 36cthulhu SwapE = _w5 37cthulhu Fst = _w6 38cthulhu Snd = _w7 39cthulhu InjectL = _w8 40cthulhu InjectR = _w9 41cthulhu Unify = _wa 42cthulhu (First fp') = _wb 43cthulhu (Second fp') = _wc 44cthulhu (Alongside fp' fp_rca'b') = _wd 45cthulhu (Fanout fp' fp_rcab') = _we 46cthulhu (Left' fp') = _wf 47cthulhu (Right' fp') = _wg 48cthulhu (EitherOf fp' fp_rca'b') = _wh 49cthulhu (Fanin fp' fp_rca'b) = _wi 50cthulhu (LiftC cab) = _wj 51cthulhu Zero = _wk 52cthulhu (Plus fp' fp_rcab) = _wl 53cthulhu (Unleft fp') = _wm 54cthulhu (Unright fp') = _wn 55