1
+ {-|
2
+ Module : Lsystem.Sugar
3
+ Description : Functions for simplifying L-system specification
4
+ Copyright : (c) Zebulun Arendsee, 2018
5
+ License : MIT
6
+
7
+ Stability : experimental
8
+ -}
9
+
1
10
module Lsystem.Sugar
2
11
(
3
12
transDol
@@ -68,11 +77,11 @@ matchWidth _ _ = Nothing
68
77
unconditional :: LeftContext -> RightContext -> Node -> a -> Maybe a
69
78
unconditional _ _ _ x = Just x
70
79
71
- -- Check is A is a similar to B. For branches, A must be a subtree of B.
80
+ -- | Check is A is a similar to B. For branches, A must be a subtree of B.
72
81
similar
73
- :: Node -- A
74
- -> Node -- B
75
- -> Bool -- True is A is in B (where `in` is weirdly defined ...)
82
+ :: Node -- ^ A
83
+ -> Node -- ^ B
84
+ -> Bool -- ^ True if A is in B (where `in` is weirdly defined ...)
76
85
similar (NodeDummy _ s) (NodeDummy _ t) = s == t
77
86
similar (NodeDraw _ _ ) (NodeDraw _ _) = True
78
87
similar (NodeRotate _ _ _ _) (NodeRotate _ _ _ _) = True
@@ -92,11 +101,11 @@ similar (NodeBranch mss) (NodeBranch nss) = any id $ map (anyBranch nss) mss
92
101
similar _ _ = False
93
102
94
103
contextMatch
95
- :: [Node ] -- elements to ignore
96
- -> [Node ] -- left contextual pattern
97
- -> [Node ] -- right contextual pattern
98
- -> [Node ] -- left context
99
- -> [Node ] -- right context
104
+ :: [Node ] -- ^ elements to ignore
105
+ -> [Node ] -- ^ left contextual pattern
106
+ -> [Node ] -- ^ right contextual pattern
107
+ -> [Node ] -- ^ left context
108
+ -> [Node ] -- ^ right context
100
109
-> a -> Maybe a -- combinator kludge (I really should go to Bool)
101
110
contextMatch ss lpat rpat lc rc x =
102
111
return x
0 commit comments