Ticket #2291: Small.hs
| File Small.hs, 466 bytes (added by guest, 5 years ago) |
|---|
| Line | |
|---|---|
| 1 | {-# OPTIONS_GHC -fglasgow-exts #-} |
| 2 | module Small where |
| 3 | |
| 4 | class CoCCC k where |
| 5 | type Coexp k :: * -> * -> * |
| 6 | type Sum k :: * -> * -> * |
| 7 | coapply :: k b (Sum k (Coexp k a b) a) |
| 8 | cocurry :: k c (Sum k a b) -> k (Coexp k b c) a |
| 9 | uncocurry :: k (Coexp k b c) a -> k c (Sum k a b) |
| 10 | |
| 11 | {-# RULES |
| 12 | "cocurry coapply" cocurry coapply = id |
| 13 | "cocurry . uncocurry" cocurry . uncocurry = id |
| 14 | "uncocurry . cocurry" uncocurry . cocurry = id |
| 15 | #-} |
