blob: 8fff381abaabfffa9514adf9ad0145a73ef776d1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
implementation module GenTree
import StdEnv
:: GenTree a b = Node a [GenTree a b] | Leaf b
:: Either a b = This a | That b
root :: (GenTree a b) -> Either a b
root ...
trees :: (GenTree a b) -> [GenTree a b]
trees ...
isNodeMember :: a (GenTree a b) -> Bool | Eq a
isNodeMember ...
isLeafMember :: b (GenTree a b) -> Bool | Eq b
isLeafMember ...
allNodes :: (GenTree a b) -> [a]
allNodes ...
allLeaves :: (GenTree a b) -> [b]
allLeaves ...
allMembers :: (GenTree a a) -> [a]
allMembers ...
map2 :: (a -> c,b -> d) (GenTree a b) -> GenTree c d
map2 ...
Start = allLeaves (Node 5 [Node 3 [Node 6 [Leaf 42.42]],Leaf 3.14])
|