aboutsummaryrefslogtreecommitdiff
path: root/sucl/graph.icl
diff options
context:
space:
mode:
Diffstat (limited to 'sucl/graph.icl')
-rw-r--r--sucl/graph.icl23
1 files changed, 9 insertions, 14 deletions
diff --git a/sucl/graph.icl b/sucl/graph.icl
index 40d153e..8812b9a 100644
--- a/sucl/graph.icl
+++ b/sucl/graph.icl
@@ -359,22 +359,17 @@ Uses in Miranda:
`Extgraph' is excluded in most import statements,
but there doesn't seem to be any other definition of it.
-
-> extgraph :: graph * ** -> graph * *** -> [***] -> pfun *** ** -> graph * ** -> graph * **
-> extgraph sgraph pattern pnodes matching graph
-> = foldr addnode graph pnodes
-> where addnode pnode
-> = total id (postcomp addnode' matching) pnode, if fst (nodecontents pattern pnode)
-> = id, otherwise
-> addnode' snode
-> = updategraph snode scont, if sdef
-> = id, otherwise
->|| = error "extgraph: closed node mapped to open node", otherwise
-> || Could have used id, but let's report error when there is one...
-> where (sdef,scont) = nodecontents sgraph snode
-
*/
+extgraph :: (Graph sym var) (Graph sym pvar) [pvar] (Pfun pvar var) (Graph sym var) -> Graph sym var | == var & == pvar
+extgraph sgraph pattern pnodes matching graph
+= foldr addnode graph pnodes
+ where addnode pnode
+ = if (fst (varcontents pattern pnode)) (total id (postcomp addnode` matching) pnode) id
+ addnode` snode
+ = if sdef (updategraph snode scont) id
+ where (sdef,scont) = varcontents sgraph snode
+
mapgraph ::
!( (Pfun var1 (sym1,[var1]))
-> Pfun .var2 (.sym2,[.var2])