diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2024-10-07 14:34:27 +0200 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2024-10-07 14:34:27 +0200 |
commit | 72eddb67bb6f048fc2076184be3a32169026a832 (patch) | |
tree | 2f5ca7511a798d7329b12d499f4dea7239b39c50 /src/AST.hs | |
parent | 948cae3ca7279040627db393e4372a668f8a22f7 (diff) |
Towards a test suite
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 |