summaryrefslogtreecommitdiff
path: root/files/practicum/GenTree.dcl
blob: a18a2720238d8d1e1dca3a1b6eac1b125e58c43d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
definition module GenTree

import StdClass

::  GenTree a b  = Node a [GenTree a b] | Leaf b

::  Either  a b  = This a | That b

root         ::   (GenTree a b) -> Either a b
trees        ::   (GenTree a b) -> [GenTree a b]

isNodeMember :: a (GenTree a b) -> Bool | Eq a
isLeafMember :: b (GenTree a b) -> Bool | Eq b
allNodes     ::   (GenTree a b) -> [a]
allLeaves    ::   (GenTree a b) -> [b]
allMembers   ::   (GenTree a a) -> [a]

map2         :: (a -> c,b -> d) (GenTree a b) -> GenTree c d