Skip to content

Commit 84a89c4

Browse files
committed
Document ufold-based functions better.
CLoses #55
1 parent 1b08580 commit 84a89c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Data/Graph/Inductive/Graph.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ order = noNodes
204204
size :: (Graph gr) => gr a b -> Int
205205
size = length . labEdges
206206

207-
-- | Fold a function over the graph.
207+
-- | Fold a function over the graph by recursively calling 'match'.
208208
ufold :: (Graph gr) => (Context a b -> c -> c) -> c -> gr a b -> c
209209
ufold f u g
210210
| isEmpty g = u
211211
| otherwise = f c (ufold f u g')
212212
where
213213
(c,g') = matchAny g
214214

215-
-- | Map a function over the graph.
215+
-- | Map a function over the graph by recursively calling 'match'.
216216
gmap :: (DynGraph gr) => (Context a b -> Context c d) -> gr a b -> gr c d
217217
gmap f = ufold (\c->(f c&)) empty
218218
{-# NOINLINE [0] gmap #-}
@@ -349,7 +349,7 @@ mkUGraph vs es = mkGraph (labUNodes vs) (labUEdges es)
349349
labUNodes = map (flip (,) ())
350350

351351
-- | Build a graph out of the contexts for which the predicate is
352-
-- true.
352+
-- satisfied by recursively calling 'match'.
353353
gfiltermap :: DynGraph gr => (Context a b -> MContext c d) -> gr a b -> gr c d
354354
gfiltermap f = ufold (maybe id (&) . f) empty
355355

0 commit comments

Comments
 (0)