Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/fields/shape.sml
ViewVC logotype

Diff of /trunk/src/compiler/fields/shape.sml

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

revision 352, Fri Sep 24 07:21:51 2010 UTC revision 353, Fri Sep 24 21:43:11 2010 UTC
# Line 21  Line 21 
21    
22      val map : ('a -> 'b) * ('c -> 'd) -> ('a,'c) shape -> ('b,'d) shape      val map : ('a -> 'b) * ('c -> 'd) -> ('a,'c) shape -> ('b,'d) shape
23    
24      (* right-to-left traversal of the tree *)
25      val foldr : ('a * 'b -> 'b) -> 'b -> ('c,'a) shape -> 'b      val foldr : ('a * 'b -> 'b) -> 'b -> ('c,'a) shape -> 'b
26    
27        val appPreOrder : ('nd -> unit) * ('lf -> unit) -> ('nd, 'lf) shape -> unit
28    
29    end = struct    end = struct
30    
31      datatype ('nd, 'lf) shape      datatype ('nd, 'lf) shape
# Line 52  Line 55 
55              fold (t, init)              fold (t, init)
56            end            end
57    
58        fun appPreOrder (ndFn, lfFn) = let
59              fun app (ND(attr, kids)) = (ndFn attr; List.app app kids)
60                | app (LF attr) = lfFn attr
61              in
62                app
63              end
64    
65    end    end

Legend:
Removed from v.352  
changed lines
  Added in v.353

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