aboutsummaryrefslogtreecommitdiff
path: root/src/Language.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-11-05 21:52:53 +0100
committerTom Smeding <tom@tomsmeding.com>2025-11-05 21:52:53 +0100
commit38150f4f9792156d8c59439fe47ecb69a0a0e00b (patch)
tree873bcfb4c952cf14ce15414e6f601cd1a9186346 /src/Language.hs
parente08936de193f71ea83b472fc9a2eaf77eb84f11b (diff)
Implement D[map]
Diffstat (limited to 'src/Language.hs')
-rw-r--r--src/Language.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Language.hs b/src/Language.hs
index c1a6248..4886ddc 100644
--- a/src/Language.hs
+++ b/src/Language.hs
@@ -108,12 +108,7 @@ build n a (v :-> b) = NEBuild n a v b
map_ :: forall n a b env name. (KnownNat n, KnownTy a)
=> (Var name a :-> NExpr ('(name, a) : env) b)
-> NExpr env (TArr n a) -> NExpr env (TArr n b)
-map_ (v :-> a) b
- | Dict <- styKnown (tTup (sreplicate (knownNat @n) tIx)) =
- let_ #arg b $
- build knownNat (shape #arg) $ #i :->
- let_ v (#arg ! #i) $
- NEDrop (SS SZ) (NEDrop (SS SZ) a)
+map_ (v :-> a) b = NEMap v a b
fold1i :: (Var name1 t :-> Var name2 t :-> NExpr ('(name2, t) : '(name1, t) : env) t) -> NExpr env t -> NExpr env (TArr (S n) t) -> NExpr env (TArr n t)
fold1i (v1@(Var s1@SSymbol t) :-> v2@(Var s2@SSymbol _) :-> e1) e2 e3 =