Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/FLINT/opt/optutils.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/opt/optutils.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 198, Sun Nov 22 02:11:29 1998 UTC revision 199, Wed Nov 25 18:30:38 1998 UTC
# Line 13  Line 13 
13    
14      (* this is a known APL function, but I don't know its real name *)      (* this is a known APL function, but I don't know its real name *)
15      val filter : bool list * 'a list -> 'a list      val filter : bool list * 'a list -> 'a list
16    
17        (* A less brain-dead version of ListPair.all: returns false if
18         * length l1 <> length l2 *)
19        val ListPair_all : ('a * 'b -> bool) -> 'a list * 'b list -> bool
20  end  end
21    
22  structure OptUtils :> OPT_UTILS =  structure OptUtils :> OPT_UTILS =
# Line 39  Line 43 
43        | filter (false::fs,x::xs) = (filter(fs, xs))        | filter (false::fs,x::xs) = (filter(fs, xs))
44        | filter _ = bug "unmatched list length in filter"        | filter _ = bug "unmatched list length in filter"
45    
46        fun ListPair_all pred =
47            let fun allp (a::r1, b::r2) = pred(a, b) andalso allp (r1, r2)
48                  | allp ([],[]) = true
49                  | allp _ = false
50            in allp
51            end
52    
53  end  end
54  end  end

Legend:
Removed from v.198  
changed lines
  Added in v.199

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0