summaryrefslogtreecommitdiff
path: root/src/Example.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2023-09-21 15:52:22 +0200
committerTom Smeding <t.j.smeding@uu.nl>2023-09-21 15:52:22 +0200
commit574569ee96a01d623baf8efdcd3908eef42b8007 (patch)
treecffc7d81e32b2b52430ac7da97a2a31102f55c97 /src/Example.hs
parent8d07a43f0b364156433dc453b9d1cc762c032634 (diff)
Storage policy (accum / merge)
Diffstat (limited to 'src/Example.hs')
-rw-r--r--src/Example.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Example.hs b/src/Example.hs
index f2e5966..ee07edf 100644
--- a/src/Example.hs
+++ b/src/Example.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE DataKinds #-}
module Example where
+import Data.Some
+
import AST
import AST.Pretty
import CHAD
@@ -13,6 +15,11 @@ bin op a b = EOp ext op (EPair ext a b)
senv1 :: SList STy [TScal TF32, TScal TF32]
senv1 = STScal STF32 `SCons` STScal STF32 `SCons` SNil
+descr1 :: Storage a -> Storage b
+ -> Descr [TScal TF32, TScal TF32] [b, a]
+descr1 a b = DTop `DPush` (t, a) `DPush` (t, b)
+ where t = STScal STF32
+
-- x y |- x * y + x
--
-- let x3 = (x1, x2)