summaryrefslogtreecommitdiff
path: root/transfer/examples/exp.tr
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-30 18:42:45 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-30 18:42:45 +0000
commit12ca29b32b50fd924c5f69a30d204e4332dff4f9 (patch)
tree0515af794def1a1737e1edf9fffad5becc5d73e7 /transfer/examples/exp.tr
parent01d1715994d2e7c58ef97fdd81dd7015a9118b17 (diff)
Transfer: derive instances, not functions.
Diffstat (limited to 'transfer/examples/exp.tr')
-rw-r--r--transfer/examples/exp.tr7
1 files changed, 5 insertions, 2 deletions
diff --git a/transfer/examples/exp.tr b/transfer/examples/exp.tr
index d6c077c03..e54b82055 100644
--- a/transfer/examples/exp.tr
+++ b/transfer/examples/exp.tr
@@ -1,3 +1,5 @@
+import prelude
+
data Cat : Type where
Stm : Cat
Exp : Cat
@@ -20,11 +22,12 @@ data Tree : Cat -> Type where
NilStm : Tree ListStm
ConsStm : Tree Stm -> Tree ListStm -> Tree ListStm
-derive composOp Tree
+derive Compos Tree
rename : (String -> String) -> (C : Type) -> Tree C -> Tree C
rename f C t = case t of
V x -> V (f x)
- _ -> composOp_Tree C (rename f) t
+ _ -> composOp ? ? compos_Tree C (rename f) t
+main = rename (const ? ? "apa") Stm (SAss (V "y") (EAdd (EVar (V "x")) (EInt 2))) \ No newline at end of file