diff options
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -129,6 +129,13 @@ tTup = mkTup STNil STPair eTup :: SList (Ex env) list -> Ex env (Tup list) eTup = mkTup (ENil ext) (EPair ext) +unTup :: (forall a b. c (TPair a b) -> (c a, c b)) + -> SList f list -> c (Tup list) -> SList c list +unTup _ SNil _ = SNil +unTup unpack (_ `SCons` list) tup = + let (xs, x) = unpack tup + in x `SCons` unTup unpack list xs + type family InvTup core env where InvTup core '[] = core InvTup core (t : ts) = InvTup (TPair core t) ts |