10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-14 10:03:39 +01:00
QCaml/Utils/Range.mli

31 lines
625 B
OCaml
Raw Normal View History

2019-02-20 18:15:15 +01:00
(** A range is a sorted list of integers in an interval.
{[ "[36-53,72-107,126-131]" ]}
represents the list of integers
{[ [ 37 ; 37 ; 38 ; ... ; 52 ; 53 ; 72 ; 73 ; ... ; 106 ; 107 ; 126 ; 127 ; ...
; 130 ; 131 ] ]}
*)
type t
val of_string : string -> t
(** Create from a string:
- "[a-b]" : range between a and b (included)
- "[a]" : the list with only one integer a
- "a" : equivalent to "[a]"
*)
val to_string : t -> string
(** String representation. *)
val to_int_list : t -> int list
(** Transform into a list of ints. *)
(** {2 Printers} *)
2019-12-02 14:58:48 +01:00
val pp : Format.formatter -> t -> unit
2019-02-20 18:15:15 +01:00