add 'mapi' equivalent for label and constructor maps
This commit is contained in:
parent
a734995bdc
commit
bc7a4daa64
@ -28,6 +28,8 @@ let bind_fold_lmap f init (lmap:_ LMap.t) =
|
||||
|
||||
let bind_map_lmap f map = bind_lmap (LMap.map f map)
|
||||
let bind_map_cmap f map = bind_cmap (CMap.map f map)
|
||||
let bind_map_lmapi f map = bind_lmap (LMap.mapi f map)
|
||||
let bind_map_cmapi f map = bind_cmap (CMap.mapi f map)
|
||||
|
||||
let range i j =
|
||||
let rec aux i j acc = if i >= j then acc else aux i (j-1) (j-1 :: acc) in
|
||||
|
@ -19,3 +19,12 @@ val is_tuple_lmap : 'a Types.label_map -> bool
|
||||
val get_pair :
|
||||
'a Types.label_map ->
|
||||
(('a * 'a) * 'b list, unit -> Trace.error) result
|
||||
|
||||
|
||||
|
||||
val bind_map_lmapi :
|
||||
(Types.label -> 'a -> ('b * 'c list, 'd) result) ->
|
||||
'a Types.label_map -> ('b Types.label_map * 'c list, 'd) result
|
||||
val bind_map_cmapi :
|
||||
(Types.constructor' -> 'a -> ('b * 'c list, 'd) result) ->
|
||||
'a Types.constructor_map -> ('b Types.constructor_map * 'c list, 'd) result
|
||||
|
Loading…
Reference in New Issue
Block a user