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 /smlnj-lib/trunk/Util/format-comb-sig.sml
ViewVC logotype

Diff of /smlnj-lib/trunk/Util/format-comb-sig.sml

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

revision 2920, Thu Dec 13 21:02:47 2007 UTC revision 2921, Tue Dec 18 04:18:29 2007 UTC
# Line 99  Line 99 
99     *)     *)
100      type 'a glue          = ('a, 'a) fragment      type 'a glue          = ('a, 'a) fragment
101      type ('a, 't) element = ('a, 't -> 'a) fragment      type ('a, 't) element = ('a, 't -> 'a) fragment
102        type 'a gg                  (* abstract helper type *)
103    
104    (* Format execution... *)    (* Format execution... *)
105    (*  1. Simple version, produce final result as a string: *)    (*  1. Simple version, produce final result as a string: *)
# Line 131  Line 132 
132    (* "polymorphic" elements *)    (* "polymorphic" elements *)
133      val list   : ('a, 'x) element -> ('a, 'x list) element (* "[", ", ", "]" *)      val list   : ('a, 'x) element -> ('a, 'x list) element (* "[", ", ", "]" *)
134      val option : ('a, 'x) element -> ('a, 'x option) element      val option : ('a, 'x) element -> ('a, 'x option) element
135      (* Parameterize "list" over delimiters and separator:      val seq    : (('x * 'a gg -> 'a gg) -> 'a gg -> 's -> 'a gg) -> (* foldr *)
136       *   delimiters are arbitrary fragments, the separator must be glue;                   'a glue ->     (* separator *)
137       *   list = list' (text "[") (text ", ") (text "]") *)                   ('a, 'x) element -> ('a, 's) element
     val list'  : ('b, 'g) fragment -> 'b glue -> ('a, 'b) fragment ->  
                  ('b, 'x) element -> ('a, 'x list -> 'g) fragment  
138    
139    (* Generic "gluifier". *)    (* Generic "gluifier". *)
140      val glue : ('a, 't) element -> 't -> 'a glue      val glue : ('a, 't) element -> 't -> 'a glue
# Line 153  Line 152 
152    (* glue generator constructors *)    (* glue generator constructors *)
153      val listg   : ('t -> 'a glue) -> ('t list -> 'a glue)      val listg   : ('t -> 'a glue) -> ('t list -> 'a glue)
154      val optiong : ('t -> 'a glue) -> ('t option -> 'a glue)      val optiong : ('t -> 'a glue) -> ('t option -> 'a glue)
155      val listg'  : ('b, 'g) fragment -> 'b glue -> ('a, 'b) fragment ->  
156                    ('t -> 'b glue) -> ('t list -> ('a, 'g) fragment)      val seqg   : (('x * 'a gg -> 'a gg) -> 'a gg -> 's -> 'a gg) -> (* foldr *)
157                     'a glue ->         (* separator *)
158                     ('x -> 'a glue) ->  (* glue maker *)
159                     's -> 'a glue      (* glue maker for container *)
160    
161    
162    (* "Places" say which side of a string to pad or trim... *)    (* "Places" say which side of a string to pad or trim... *)
163      type place      type place

Legend:
Removed from v.2920  
changed lines
  Added in v.2921

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