]> Joshua Wise's Git repositories - snipe.git/blobdiff - util/symbol.sml
Initial import of l4c
[snipe.git] / util / symbol.sml
index 87a0ab9c06b219e7c790cfca146e99f709f0c4eb..3111761560c14f517d9d591dc14b606de91e64d0 100644 (file)
@@ -39,6 +39,11 @@ sig
   val elemsi : 'a table -> (symbol * 'a) list (* return the symbols with the associated data *)
   val keys : 'a table -> symbol list (* just the symbols *)
   val intersect : ('a * 'a -> 'a) -> 'a table * 'a table -> 'a table
+  
+  val mapi : (symbol * 'a -> 'b) -> 'a table -> 'b table
+  val mapPartial : ('a -> 'b option) -> 'a table -> 'b table
+  val mapPartiali : (symbol * 'a -> 'b option) -> 'a table -> 'b table
+  val appi : (symbol * 'a -> unit) -> 'a table -> unit
 
   (* symbol set -- similar to a () Symbol.table, elements can be removed *)
   type set
@@ -105,6 +110,10 @@ struct
   fun elemsi t = Map.listItemsi t
   fun keys t = Map.listKeys t
   fun intersect binding (t1,t2) = Map.intersectWith binding (t1,t2)
+  fun mapi f t = Map.mapi f t
+  fun mapPartial f t = Map.mapPartial f t
+  fun mapPartiali f t = Map.mapPartiali f t
+  fun appi f t = Map.appi f t
 
   fun delimit' [] s = s
     | delimit' [x] s = s ^ x
This page took 0.023198 seconds and 4 git commands to generate.