summaryrefslogtreecommitdiff
path: root/files/practicum/StdRoseTree.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'files/practicum/StdRoseTree.dcl')
-rw-r--r--files/practicum/StdRoseTree.dcl20
1 files changed, 20 insertions, 0 deletions
diff --git a/files/practicum/StdRoseTree.dcl b/files/practicum/StdRoseTree.dcl
new file mode 100644
index 0000000..5d6609d
--- /dev/null
+++ b/files/practicum/StdRoseTree.dcl
@@ -0,0 +1,20 @@
+definition module StdRoseTree
+
+import StdClass
+
+/** This module defines rose trees.
+*/
+:: RoseTree a = Node a [RoseTree a]
+:: Children a :== a -> [a]
+:: PruneDepth :== Int
+
+iteratetree :: !(Children a) a -> RoseTree a
+
+root :: !(RoseTree a) -> a
+children :: !(RoseTree a) -> [RoseTree a]
+depth :: !(RoseTree a) -> Int
+
+maptree :: (a -> b) !(RoseTree a) -> RoseTree b
+prunetree :: !PruneDepth !(RoseTree a) -> RoseTree a
+bonsai :: !(RoseTree a) -> RoseTree a | Eq a
+paths :: !(RoseTree a) -> [[a]]