Commit 9deedfc1 authored by Vincent Zweije's avatar Vincent Zweije
Browse files

This commit was generated by cvs2svn to compensate for changes in r686,

which included commits to RCS files with non-trunk default branches.
parent bf198574
...@@ -15,6 +15,7 @@ Basic types and functions. ...@@ -15,6 +15,7 @@ Basic types and functions.
*/ */
from general import Optional from general import Optional
from StdFile import <<<
import StdOverloaded import StdOverloaded
import StdString import StdString
...@@ -72,6 +73,9 @@ foldmap :: (x:res -> w:res`) w:res` -> u:(![(arg,x:res)] -> v:(arg -> w:res`)) | ...@@ -72,6 +73,9 @@ foldmap :: (x:res -> w:res`) w:res` -> u:(![(arg,x:res)] -> v:(arg -> w:res`)) |
// Foldoptional is the standard fold for the optional type. // Foldoptional is the standard fold for the optional type.
foldoptional :: .res .(.t -> .res) !(Optional .t) -> .res foldoptional :: .res .(.t -> .res) !(Optional .t) -> .res
// Force evaluation of first argument to root normal form before returning second
force :: !.a .b -> .b
// Forget drops a mapped value from a map given by a list. // Forget drops a mapped value from a map given by a list.
forget :: val -> .(![.(val,res)] -> .[(val,res)]) | == val forget :: val -> .(![.(val,res)] -> .[(val,res)]) | == val
...@@ -97,6 +101,12 @@ join :: a ![.[a]] -> .[a] ...@@ -97,6 +101,12 @@ join :: a ![.[a]] -> .[a]
*/ */
kleene :: !.[symbol] -> .[[symbol]] kleene :: !.[symbol] -> .[[symbol]]
// Lazy variant of the predefined abort function
error :: .String -> .a
// Determine the string representation of a list
listToString :: [a] -> String | toString a
// Lookup finds a value mapped in a list mapping. // Lookup finds a value mapped in a list mapping.
lookup :: u:([(arg,w:res)] -> v:(arg -> w:res)) | == arg, [v u <= w] lookup :: u:([(arg,w:res)] -> v:(arg -> w:res)) | == arg, [v u <= w]
...@@ -130,6 +140,9 @@ maptl :: .(x:[.a] -> u:[.a]) !w:[.a] -> v:[.a], [u <= v, w <= x] ...@@ -130,6 +140,9 @@ maptl :: .(x:[.a] -> u:[.a]) !w:[.a] -> v:[.a], [u <= v, w <= x]
// Map three functions onto a triple. // Map three functions onto a triple.
maptriple :: x:(.a -> .b) w:(.c -> .d) v:(.e -> .f) -> u:((.a,.c,.e) -> (.b,.d,.f)), [u <= v, u <= w, u <= x] maptriple :: x:(.a -> .b) w:(.c -> .d) v:(.e -> .f) -> u:((.a,.c,.e) -> (.b,.d,.f)), [u <= v, u <= w, u <= x]
// String representation of line terminator
nl :: String
// Pairwith pairs a value with its result under a given function // Pairwith pairs a value with its result under a given function
pairwith :: .(arg -> .res) arg -> (arg,.res) pairwith :: .(arg -> .res) arg -> (arg,.res)
...@@ -156,12 +169,18 @@ relimg :: ![(a,.b)] a -> [.b] | == a ...@@ -156,12 +169,18 @@ relimg :: ![(a,.b)] a -> [.b] | == a
// `Remap x y mapping' alters the mapping by associating y with x, removing the old values. // `Remap x y mapping' alters the mapping by associating y with x, removing the old values.
remap :: a b [.(a,b)] -> .[(a,b)] | == a remap :: a b [.(a,b)] -> .[(a,b)] | == a
// A variant of foldl that is strict in its accumulator
sfoldl :: (.a -> .(.b -> .a)) !.a [.b] -> .a
// `Shorter xs' determines whether a list is shorter than list `xs'. // `Shorter xs' determines whether a list is shorter than list `xs'.
shorter :: ![.a] [.b] -> .Bool shorter :: ![.a] [.b] -> .Bool
// `Showbool b' is the string representation of boolean `b'. // `Showbool b' is the string representation of boolean `b'.
showbool :: .(!.Bool -> a) | fromBool a showbool :: .(!.Bool -> a) | fromBool a
// Determine a string representation of a list
showlist :: (.elem -> .String) ![.elem] -> String
// `Showoptional showa opt' is the string representation of optional value `opt', // `Showoptional showa opt' is the string representation of optional value `opt',
// where `showa' determines the string representation of the inner value. // where `showa' determines the string representation of the inner value.
showoptional :: .(.a -> .String) !(Optional .a) -> String showoptional :: .(.a -> .String) !(Optional .a) -> String
...@@ -187,3 +206,9 @@ superset :: .[a] -> .(.[a] -> Bool) | == a ...@@ -187,3 +206,9 @@ superset :: .[a] -> .(.[a] -> Bool) | == a
// zipwith zips up two lists with a joining function // zipwith zips up two lists with a joining function
zipwith :: (.a .b->.c) ![.a] [.b] -> [.c] zipwith :: (.a .b->.c) ![.a] [.b] -> [.c]
// Strict version of --->, which evaluates its lhs first
(<---) infix :: !.a !b -> .a | <<< b
// Sequential evaluation of left and right arguments
($) infixr :: !.a .b -> .b
...@@ -25,7 +25,7 @@ Implementation ...@@ -25,7 +25,7 @@ Implementation
//:: Optional t = Absent | Present t //:: Optional t = Absent | Present t
// Now using Optional type from cocl's general module // Now using Optional type from cocl's general module
from general import Optional,No,Yes from general import Optional,No,Yes,--->
instance == (Optional a) | == a instance == (Optional a) | == a
where (==) No No = True where (==) No No = True
...@@ -56,15 +56,16 @@ results recursively, and so on. Duplicates are removed. */ ...@@ -56,15 +56,16 @@ results recursively, and so on. Duplicates are removed. */
depthfirst :: (res->.[elem]) (elem->res) !.[elem] -> .[res] | == elem depthfirst :: (res->.[elem]) (elem->res) !.[elem] -> .[res] | == elem
depthfirst generate process xs depthfirst generate process xs
= snd (collect xs ([],[])) = snd (collect xs ([],[]))
where collect [] seenrest = seenrest where collect [] seenrest = seenrest
collect [x:xs] (seen,rest) collect [x:xs] seenrest
| isMember x seen | isMember x seen
= collect xs (seen,rest) = collect xs seenrest
= (seen``,[y:rest``]) = (seen``,[y:rest``])
where (seen`,rest``) = collect (generate y) ([x:seen],rest`) where (seen`,rest``) = collect (generate y) ([x:seen],rest`)
(seen``,rest`) = collect xs ( seen`,rest) (seen``,rest`) = collect xs ( seen`,rest)
y = process x y = process x
(seen,rest) = seenrest
// `Disjoint xs ys' checks whether xs and ys are disjoint. // `Disjoint xs ys' checks whether xs and ys are disjoint.
...@@ -89,22 +90,28 @@ foldlm f (l,[m:ms]) ...@@ -89,22 +90,28 @@ foldlm f (l,[m:ms])
(l``,ms`) = foldlm f (l`,ms) (l``,ms`) = foldlm f (l`,ms)
foldlr :: (.elem -> .((.lrinfo,.rlinfo) -> (.lrinfo,.rlinfo))) !(.lrinfo,.rlinfo) ![.elem] -> (.lrinfo,.rlinfo) foldlr :: (.elem -> .((.lrinfo,.rlinfo) -> (.lrinfo,.rlinfo))) !(.lrinfo,.rlinfo) ![.elem] -> (.lrinfo,.rlinfo)
foldlr f (l,r) [] foldlr f lr []
= (l,r) = lr
foldlr f (l,r) [x:xs] foldlr f lr [x:xs]
= (l``,r``) = (l``,r``)
where (l``,r`) = foldlr f (l`,r) xs where (l``,r`) = foldlr f (l`,r) xs
(l`,r``) = f x (l,r`) (l`,r``) = f x (l,r`)
(l,r) = lr
foldmap :: (x:res -> w:res`) w:res` -> u:(![(arg,x:res)] -> v:(arg -> w:res`)) | == arg, [v u <= w, v <= x] foldmap :: (x:res -> w:res`) w:res` -> u:(![(arg,x:res)] -> v:(arg -> w:res`)) | == arg, [v u <= w, v <= x]
foldmap f d foldmap f d
= foldr foldmap` (const d) = foldr foldmap` (const d)
where foldmap` (x,y) g v = if (x==v) (f y) (g v) where foldmap` xy g v
= if (x==v) (f y) (g v)
where (x,y) = xy
foldoptional :: .res .(.t -> .res) !(Optional .t) -> .res foldoptional :: .res .(.t -> .res) !(Optional .t) -> .res
foldoptional no yes No = no foldoptional no yes No = no
foldoptional no yes (Yes x) = yes x foldoptional no yes (Yes x) = yes x
force :: !.a .b -> .b
force x y = y
forget :: val -> .(![.(val,res)] -> .[(val,res)]) | == val forget :: val -> .(![.(val,res)] -> .[(val,res)]) | == val
forget x = filter (neq x o fst) forget x = filter (neq x o fst)
neq x y = x <> y neq x y = x <> y
...@@ -159,6 +166,14 @@ kleene symbols ...@@ -159,6 +166,14 @@ kleene symbols
= flatten (map appendstrings symbols) = flatten (map appendstrings symbols)
where appendstrings symbol = map (cons symbol) strings where appendstrings symbol = map (cons symbol) strings
// Lazy variant of the predefined abort function
error :: .String -> .a
error message = abort message
// Determine the string representation of a list
listToString :: [a] -> String | toString a
listToString xs = showlist toString xs
lookup :: u:([(arg,w:res)] -> v:(arg -> w:res)) | == arg, [v u <= w] lookup :: u:([(arg,w:res)] -> v:(arg -> w:res)) | == arg, [v u <= w]
lookup = foldmap id (abort "lookup: not found") lookup = foldmap id (abort "lookup: not found")
...@@ -211,6 +226,10 @@ maptl f [x:xs] = [x:f xs] ...@@ -211,6 +226,10 @@ maptl f [x:xs] = [x:f xs]
maptriple :: x:(.a -> .b) w:(.c -> .d) v:(.e -> .f) -> u:((.a,.c,.e) -> (.b,.d,.f)), [u <= v, u <= w, u <= x] maptriple :: x:(.a -> .b) w:(.c -> .d) v:(.e -> .f) -> u:((.a,.c,.e) -> (.b,.d,.f)), [u <= v, u <= w, u <= x]
maptriple f g h = app3 (f,g,h) maptriple f g h = app3 (f,g,h)
// String representation of line terminator
nl :: String
nl =: "\n"
partition :: (a -> b) (a -> .c) -> .(!.[a] -> [(b,[.c])]) | == b partition :: (a -> b) (a -> .c) -> .(!.[a] -> [(b,[.c])]) | == b
partition f g partition f g
= h = h
...@@ -227,6 +246,14 @@ relimg rel x` = [y\\(x,y)<-rel|x==x`] ...@@ -227,6 +246,14 @@ relimg rel x` = [y\\(x,y)<-rel|x==x`]
remap :: a b [.(a,b)] -> .[(a,b)] | == a remap :: a b [.(a,b)] -> .[(a,b)] | == a
remap x y xys = [(x,y):forget x xys] remap x y xys = [(x,y):forget x xys]
// A variant of foldl that is strict in its accumulator
sfoldl :: (.a -> .(.b -> .a)) !.a [.b] -> .a
sfoldl f a xxs
#! a = a
= case xxs
of [] -> a
[x:xs] -> sfoldl f (f a x) xs
shorter :: ![.a] [.b] -> .Bool shorter :: ![.a] [.b] -> .Bool
shorter [] yys = False shorter [] yys = False
shorter [x:xs] [] = True shorter [x:xs] [] = True
...@@ -235,6 +262,14 @@ shorter [x:xs] [y:ys] = shorter xs ys ...@@ -235,6 +262,14 @@ shorter [x:xs] [y:ys] = shorter xs ys
showbool :: .(!.Bool -> a) | fromBool a showbool :: .(!.Bool -> a) | fromBool a
showbool = fromBool showbool = fromBool
showlist :: (.elem -> .String) ![.elem] -> String
showlist showa xs
= "["+++inner xs+++"]"
where inner [] = ""
inner [x:xs] = showa x+++continue xs
continue [] = ""
continue [x:xs] = ","+++showa x+++continue xs
showoptional :: .(.a -> .String) !(Optional .a) -> String showoptional :: .(.a -> .String) !(Optional .a) -> String
showoptional showa No = "No" showoptional showa No = "No"
showoptional showa (Yes a) = "(Yes "+++showa a+++")" showoptional showa (Yes a) = "(Yes "+++showa a+++")"
...@@ -268,3 +303,15 @@ superset set = isEmpty o (removeMembers set) ...@@ -268,3 +303,15 @@ superset set = isEmpty o (removeMembers set)
zipwith :: (.a .b->.c) ![.a] [.b] -> [.c] zipwith :: (.a .b->.c) ![.a] [.b] -> [.c]
zipwith f xs ys = [f x y \\ x<-xs & y<-ys] zipwith f xs ys = [f x y \\ x<-xs & y<-ys]
// Strict version of --->, which evaluates its lhs first
(<---) infix :: !.a !b -> .a | <<< b
(<---) value message = value ---> message
($) infixr :: !.a .b -> .b
($) x y = y
(writeList) infixl :: !*File [a] -> .File | <<< a
(writeList) file [] = file
(writeList) file [x:xs]
= file <<< x writeList xs
...@@ -5,6 +5,7 @@ implementation module canon ...@@ -5,6 +5,7 @@ implementation module canon
import rule import rule
import graph import graph
import basic import basic
import general
import StdEnv import StdEnv
/* /*
...@@ -60,7 +61,7 @@ steps: ...@@ -60,7 +61,7 @@ steps:
canonise :: (sym -> Rule tsym tvar) [var2] (Rgraph sym var1) -> Rgraph sym var2 | == var1 canonise :: (sym -> Rule tsym tvar) [var2] (Rgraph sym var1) -> Rgraph sym var2 | == var1
canonise typerule heap rg canonise typerule heap rg
= (relabel heap o etaexpand typerule o splitrg o relabel localheap) rg = ((relabel heap o etaexpand typerule o splitrg o relabel localheap) rg <--- "canon.canonise ends") ---> "canon.canonise begins"
/* /*
...@@ -113,9 +114,10 @@ localheap =: [0..] ...@@ -113,9 +114,10 @@ localheap =: [0..]
foldarea :: ((Rgraph sym var) -> sym) (Rgraph sym var) -> Node sym var | == var foldarea :: ((Rgraph sym var) -> sym) (Rgraph sym var) -> Node sym var | == var
foldarea label rgraph foldarea label rgraph
= (label rgraph,foldsingleton single nosingle rgraph) = ((id (labelrgraph,foldsingleton single nosingle rgraph)) <--- "canon.foldarea ends") ---> "canon.foldarea begins"
where single root sym args = args where single root sym args = args
nosingle = snd (graphvars (rgraphgraph rgraph) [rgraphroot rgraph]) nosingle = snd (graphvars (rgraphgraph rgraph) [rgraphroot rgraph])
labelrgraph = (label rgraph <--- "canon.foldarea.labelrgraph ends") ---> "canon.foldarea.labelrgraph begins"
/* /*
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -139,13 +141,13 @@ foldarea label rgraph ...@@ -139,13 +141,13 @@ foldarea label rgraph
labelarea :: [Rgraph sym var] [sym] (Rgraph sym var) -> sym | == sym & == var labelarea :: [Rgraph sym var] [sym] (Rgraph sym var) -> sym | == sym & == var
labelarea areas labels rg labelarea areas labels rg
= foldmap id nolabel (maketable areas labels) rg = ((foldmap--->"canon.labelarea uses foldmap") id nolabel ((maketable--->"canon.maketable begins from canon.labelarea") ((areas<---"canon.labelarea.areas ends")--->"canon.labelarea.areas begins") ((labels<---"canon.labelarea.labels ends")--->"canon.labelarea.labels begins")) ((rg<---"canon.labelarea.rg ends")--->"canon.labelarea.rg begins") <--- "canon.labelarea ends") ---> "canon.labelarea begins"
where nolabel = abort "canon: labelarea: no label assigned to area" where nolabel = abort "canon: labelarea: no label assigned to area"
maketable :: [Rgraph sym var] [sym] -> [(Rgraph sym var,sym)] | == var maketable :: [Rgraph sym var] [sym] -> [(Rgraph sym var,sym)] | == var
maketable [] _ = [] maketable [] _ = [] <--- "canon.maketable ends empty"
maketable [area:areas] labels maketable [area:areas] labels
= [(area,label):maketable areas labels`] = [(((area<---"canon.maketable.area ends")--->"canon.maketable.area begins",(label<---"canon.maketable.label ends")--->"canon.maketable.label begins") <--- "canon.maketable.head ends") ---> "canon.maketable.head begins":(maketable--->"canon.maketable begins from maketable") areas labels`] <--- "canon.maketable ends nonempty"
where (label,labels`) = getlabel (nc aroot) labels where (label,labels`) = getlabel (nc aroot) labels
getlabel (True,(asym,aargs)) labels getlabel (True,(asym,aargs)) labels
| not (or (map (fst o nc) aargs)) | not (or (map (fst o nc) aargs))
......
...@@ -3,6 +3,7 @@ implementation module complete ...@@ -3,6 +3,7 @@ implementation module complete
// $Id$ // $Id$
import graph import graph
import basic
import StdEnv import StdEnv
/* /*
...@@ -78,10 +79,11 @@ coveredby complete subject pvarss [svar:svars] ...@@ -78,10 +79,11 @@ coveredby complete subject pvarss [svar:svars]
| complete (map fst3 closeds) | complete (map fst3 closeds)
= and (map covered closeds) = and (map covered closeds)
= coveredby complete subject opens svars = coveredby complete subject opens svars
where (opens,closeds) = split pvarss where (opens,closeds) = psplit pvarss
covered (sym,repvar`,pvarss`) = coveredby complete subject pvarss` (repvar (repvar` undef) svar++svars) covered (sym,repvar`,pvarss`) = coveredby complete subject pvarss` (repvar (repvar` dummyvar) svar++svars)
(sdef,(ssym,sargs)) = varcontents subject svar (sdef,(ssym,sargs)) = varcontents subject svar
tmpvalue = (fst (foldr (spl (repvar sargs) ssym) ([],[]) pvarss)) tmpvalue = (fst (foldr (spl (repvar sargs) ssym) ([],[]) pvarss))
dummyvar = abort "complete: error: accessing dummy variable"
repvar pvars svar = map (const svar) pvars repvar pvars svar = map (const svar) pvars
...@@ -94,7 +96,7 @@ multipatterns with an open pattern are expanded and added as well. ...@@ -94,7 +96,7 @@ multipatterns with an open pattern are expanded and added as well.
*/ */
split psplit
:: [Pattern sym var] :: [Pattern sym var]
-> ( [Pattern sym var] -> ( [Pattern sym var]
, [ ( sym , [ ( sym
...@@ -106,14 +108,14 @@ split ...@@ -106,14 +108,14 @@ split
| == sym | == sym
& == var & == var
split [] = ([],[]) psplit [] = ([],[])
split [(subject,[svar:svars]):svarss] psplit [(subject,[svar:svars]):svarss]
| not sdef | not sdef
= ([(subject,svars):opens`],map add closeds`) = ([(subject,svars):opens`],map add closeds`)
= (opens,[(ssym,repvar,[(subject,sargs++svars):ins]):closeds]) = (opens,[(ssym,repvar,[(subject,sargs++svars):ins]):closeds])
where (opens`,closeds`) = split svarss where (opens`,closeds`) = psplit svarss
add (sym,repvar,svarss`) = (sym,repvar,[(subject,repvar svar++svars):svarss`]) add (sym,repvar,svarss`) = (sym,repvar,[(subject,repvar svar++svars):svarss`])
(opens,closeds) = split outs (opens,closeds) = psplit outs
(ins,outs) = foldr (spl repvar ssym) ([],[]) svarss (ins,outs) = foldr (spl repvar ssym) ([],[]) svarss
repvar svar = map (const svar) sargs repvar svar = map (const svar) sargs
(sdef,(ssym,sargs)) = varcontents subject svar (sdef,(ssym,sargs)) = varcontents subject svar
......
...@@ -3,6 +3,7 @@ implementation module dnc ...@@ -3,6 +3,7 @@ implementation module dnc
// $Id$ // $Id$
import graph import graph
import basic
import StdEnv import StdEnv
// dnc is like varcontents, but can give a more reasonable error message // dnc is like varcontents, but can give a more reasonable error message
......
...@@ -4,6 +4,7 @@ definition module graph ...@@ -4,6 +4,7 @@ definition module graph
from pfun import Pfun from pfun import Pfun
from StdOverloaded import == from StdOverloaded import ==
from StdString import String,toString
// A rule associating a replacement with a pattern // A rule associating a replacement with a pattern
//:: Rule sym var //:: Rule sym var
...@@ -139,6 +140,9 @@ varlist :: .(Graph sym var) !.[var] -> .[var] | == var ...@@ -139,6 +140,9 @@ varlist :: .(Graph sym var) !.[var] -> .[var] | == var
// Cannot remember what this one does??? // Cannot remember what this one does???
prefix :: .(Graph sym var) .[var] !.[var] -> .([var],[var]) | == var prefix :: .(Graph sym var) .[var] !.[var] -> .([var],[var]) | == var
// Determine a multiline representation of a graph with multiple roots
printgraph :: .(Graph sym var) .[var] -> .[String] | toString sym & toString var & == var
// Do reference counting in a graph for the outer bindings. // Do reference counting in a graph for the outer bindings.
// References from case branches are counted once only. // References from case branches are counted once only.
// Initial list of variables is counted too. // Initial list of variables is counted too.
......
...@@ -4,6 +4,7 @@ implementation module graph ...@@ -4,6 +4,7 @@ implementation module graph
import pfun import pfun
import basic import basic
import general
import StdEnv import StdEnv
/* /*
...@@ -157,7 +158,30 @@ prefix graph without vars ...@@ -157,7 +158,30 @@ prefix graph without vars
> = (seen1,'(':showfunc func++concat (map (' ':) repr1)++")"), otherwise > = (seen1,'(':showfunc func++concat (map (' ':) repr1)++")"), otherwise
> (seen1,repr1) = foldlr pg (node:seen,[]) args > (seen1,repr1) = foldlr pg (node:seen,[]) args
> (def,(func,args)) = nodecontents graph node > (def,(func,args)) = nodecontents graph node
*/
printgraph :: .(Graph sym var) .[var] -> .[String] | toString sym & toString var & == var
printgraph graph nodes
= prntgrph (refcount graph nodes) graph nodes
prntgrph count graph nodes
= snd (foldlr pg ([],[]) nodes)
where pg node (seen,reprs)
= (seen2,[repr3:reprs])
where repr3
= if (not (isMember node seen) && def && count node>1)
(toString node+++":"+++repr2)
repr2
(seen2,repr2)
= if (isMember node seen || not def)
(seen,toString node)
(if (args==[])
(seen1,toString func)
(seen1,"("+++toString func+++foldr (+++) ")" (map ((+++)" ") repr1)))
(seen1,repr1) = foldlr pg ([node:seen],[]) args
(def,(func,args)) = varcontents graph node
/*
> refcount graph > refcount graph
> = foldr rfcnt (const 0) > = foldr rfcnt (const 0)
> where rfcnt node count > where rfcnt node count
...@@ -396,5 +420,5 @@ mapgraph :: ...@@ -396,5 +420,5 @@ mapgraph ::
mapgraph f (GraphAlias pfun) = GraphAlias (f pfun) mapgraph f (GraphAlias pfun) = GraphAlias (f pfun)
instance == (Graph sym var) | == sym & == var instance == (Graph sym var) | == sym & == var
where (==) pf1 pf2 where (==) (GraphAlias pf1) (GraphAlias pf2)
= pf1 == pf2 = ((pf1 == pf2) <--- "graph.==(Graph) ends") ---> "graph.==(Graph) begins"
...@@ -6,6 +6,7 @@ from rule import Rgraph ...@@ -6,6 +6,7 @@ from rule import Rgraph
from graph import Graph from graph import Graph
from general import Optional from general import Optional
from StdOverloaded import == from StdOverloaded import ==
from StdString import toString
// A history relates node-ids in the subject graph to patterns // A history relates node-ids in the subject graph to patterns
:: History sym var :: History sym var
...@@ -35,3 +36,6 @@ matchhistory ...@@ -35,3 +36,6 @@ matchhistory
-> [HistoryPattern sym var] // Matching history patterns -> [HistoryPattern sym var] // Matching history patterns
| == sym | == sym
& == var & == var
(writeHistory) infixl :: *File (History sym var) -> .File | toString sym & toString,== var
(writeHistoryAssociation) infixl :: *File (HistoryAssociation sym var) -> .File | toString sym & toString,== var
...@@ -59,3 +59,9 @@ instantiate :: ...@@ -59,3 +59,9 @@ instantiate ::
([(pvar,var)],[(pvar,var)],[(pvar,var)]) ([(pvar,var)],[(pvar,var)],[(pvar,var)])
-> ([(pvar,var)],[(pvar,var)],[(pvar,var)]) -> ([(pvar,var)],[(pvar,var)],[(pvar,var)])
*/ */
(writeHistory) infixl :: *File (History sym var) -> .File | toString sym & toString,== var
(writeHistory) file history = sfoldl (writeHistoryAssociation) file history
(writeHistoryAssociation) infixl :: *File (HistoryAssociation sym var) -> .File | toString sym & toString,== var
(writeHistoryAssociation) file ha = file <<< showpair toString (showlist toString) ha <<< nl
...@@ -11,7 +11,7 @@ import rule ...@@ -11,7 +11,7 @@ import rule
import graph import graph
import pfun import pfun
import basic import basic
from general import Yes,No from general import Yes,No,--->
import StdEnv import StdEnv
/* /*
...@@ -341,8 +341,8 @@ startswith _ _ = False ...@@ -341,8 +341,8 @@ startswith _ _ = False