summaryrefslogtreecommitdiff
path: root/src/Example.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2023-09-21 16:06:39 +0200
committerTom Smeding <t.j.smeding@uu.nl>2023-09-21 16:06:39 +0200
commit0f8b95b042ad39df27972b006345922fcaf5cab5 (patch)
treeb269d22b3161a0e09cfc6fa65d741cce42ede03a /src/Example.hs
parent574569ee96a01d623baf8efdcd3908eef42b8007 (diff)
Pretty print let bindings in do notation
Diffstat (limited to 'src/Example.hs')
-rw-r--r--src/Example.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Example.hs b/src/Example.hs
index ee07edf..ee91981 100644
--- a/src/Example.hs
+++ b/src/Example.hs
@@ -92,6 +92,10 @@ ex4 =
senv5 :: SList STy [TScal TF32, TEither (TScal TF32) (TScal TF32)]
senv5 = STScal STF32 `SCons` STEither (STScal STF32) (STScal STF32) `SCons` SNil
+descr5 :: Storage a -> Storage b
+ -> Descr [TScal TF32, TEither (TScal TF32) (TScal TF32)] [b, a]
+descr5 a b = DTop `DPush` (STEither (STScal STF32) (STScal STF32), a) `DPush` (STScal STF32, b)
+
-- x:R+R y:R |- case x of {inl a -> a * y ; inr b -> b * (y + 1)}
ex5 :: Ex [TScal TF32, TEither (TScal TF32) (TScal TF32)] (TScal TF32)
ex5 =