diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2025-03-09 22:08:17 +0100 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2025-03-09 22:08:17 +0100 |
commit | c3b4f56760547940256afea8e692681dbbe21857 (patch) | |
tree | 04e7aeee8ebbd78f937c7b4e34a08bec995beca9 /src/AST.hs | |
parent | da5dbc4ebca51a32b43bec360470c037cab1755f (diff) |
Clean up code organisation a little
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -129,32 +129,9 @@ type Ex = Expr (Const ()) ext :: Const () a ext = Const () -type family Tup env where - Tup '[] = TNil - Tup (t : ts) = TPair (Tup ts) t - -mkTup :: f TNil -> (forall a b. f a -> f b -> f (TPair a b)) - -> SList f list -> f (Tup list) -mkTup nil _ SNil = nil -mkTup nil pair (e `SCons` es) = pair (mkTup nil pair es) e - -tTup :: SList STy env -> STy (Tup env) -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 - type SOp :: Ty -> Ty -> Type data SOp a t where OAdd :: ScalIsNumeric a ~ True => SScalTy a -> SOp (TPair (TScal a) (TScal a)) (TScal a) |