sig
type 'a t
val regex : Re.t -> string Tyre.t
val conv :
name:string -> ('a -> 'b option) -> ('b -> 'a) -> 'a Tyre.t -> 'b Tyre.t
val opt : 'a Tyre.t -> 'a option Tyre.t
val alt : 'a Tyre.t -> 'b Tyre.t -> [ `Left of 'a | `Right of 'b ] Tyre.t
type 'a gen = unit -> 'a option
val rep : 'a Tyre.t -> 'a Tyre.gen Tyre.t
val rep1 : 'a Tyre.t -> ('a * 'a Tyre.gen) Tyre.t
val seq : 'a Tyre.t -> 'b Tyre.t -> ('a * 'b) Tyre.t
val prefix : 'b Tyre.t * 'b -> 'a Tyre.t -> 'a Tyre.t
val prefixstr : string -> 'a Tyre.t -> 'a Tyre.t
val suffix : 'a Tyre.t -> 'b Tyre.t * 'b -> 'a Tyre.t
val suffixstr : 'a Tyre.t -> string -> 'a Tyre.t
val ( <?> ) :
'a Tyre.t -> 'b Tyre.t -> [ `Left of 'a | `Right of 'b ] Tyre.t
val ( <*> ) : 'a Tyre.t -> 'b Tyre.t -> ('a * 'b) Tyre.t
val ( *> ) : string -> 'a Tyre.t -> 'a Tyre.t
val ( <* ) : 'a Tyre.t -> string -> 'a Tyre.t
val ( **> ) : 'b Tyre.t * 'b -> 'a Tyre.t -> 'a Tyre.t
val ( <** ) : 'a Tyre.t -> 'b Tyre.t * 'b -> 'a Tyre.t
val int : int Tyre.t
val pos_int : int Tyre.t
val float : float Tyre.t
val bool : bool Tyre.t
val list : 'a Tyre.t -> 'a list Tyre.t
val terminated_list : sep:string -> 'a Tyre.t -> 'a list Tyre.t
val separated_list : sep:string -> 'a Tyre.t -> 'a list Tyre.t
val word : 'a Tyre.t -> 'a Tyre.t
val whole_string : 'a Tyre.t -> 'a Tyre.t
val longest : 'a Tyre.t -> 'a Tyre.t
val shortest : 'a Tyre.t -> 'a Tyre.t
val first : 'a Tyre.t -> 'a Tyre.t
val greedy : 'a Tyre.t -> 'a Tyre.t
val non_greedy : 'a Tyre.t -> 'a Tyre.t
val nest : 'a Tyre.t -> 'a Tyre.t
type 'a re
val compile : ?whole:bool -> 'a Tyre.t -> 'a Tyre.re
type 'a error =
[ `ConverterFailure of string * string
| `NoMatch of 'a Tyre.re * string ]
val exec :
?pos:int ->
?len:int -> 'a Tyre.re -> string -> ('a, 'a Tyre.error) Result.result
type +'a route = Route : 'x Tyre.t * ('x -> 'a) -> 'a Tyre.route
val ( --> ) : 'x Tyre.t -> ('x -> 'a) -> 'a Tyre.route
val route : ?whole:bool -> 'a Tyre.route list -> 'a Tyre.re
val eval : 'a Tyre.t -> 'a -> string
val evalpp : 'a Tyre.t -> Format.formatter -> 'a -> unit
val pp : Format.formatter -> 'a Tyre.t -> unit
val pp_re : Format.formatter -> 'a Tyre.re -> unit
module Internal :
sig
exception ConverterFailure of string * string
type ('a, 'b) conv = { to_ : 'a -> 'b option; from_ : 'b -> 'a; }
type 'a raw =
Regexp : Re.t * Re.re Lazy.t -> string Tyre.Internal.raw
| Conv : string * 'a Tyre.Internal.raw *
('a, 'b) Tyre.Internal.conv -> 'b Tyre.Internal.raw
| Opt : 'a Tyre.Internal.raw -> 'a option Tyre.Internal.raw
| Alt : 'a Tyre.Internal.raw *
'b Tyre.Internal.raw -> [ `Left of 'a | `Right of 'b ]
Tyre.Internal.raw
| Seq : 'a Tyre.Internal.raw *
'b Tyre.Internal.raw -> ('a * 'b) Tyre.Internal.raw
| Prefix : 'b Tyre.Internal.raw * 'b *
'a Tyre.Internal.raw -> 'a Tyre.Internal.raw
| Suffix : 'a Tyre.Internal.raw * 'b *
'b Tyre.Internal.raw -> 'a Tyre.Internal.raw
| Rep : 'a Tyre.Internal.raw -> 'a Tyre.gen Tyre.Internal.raw
| Mod : (Re.t -> Re.t) * 'a Tyre.Internal.raw -> 'a Tyre.Internal.raw
val from_t : 'a Tyre.t -> 'a Tyre.Internal.raw
val to_t : 'a Tyre.Internal.raw -> 'a Tyre.t
type _ wit =
Regexp : Re.t -> string Tyre.Internal.wit
| Conv : string * 'a Tyre.Internal.wit *
('a, 'b) Tyre.Internal.conv -> 'b Tyre.Internal.wit
| Opt : Re.markid * int *
'a Tyre.Internal.wit -> 'a option Tyre.Internal.wit
| Alt : Re.markid * int * 'a Tyre.Internal.wit * Re.markid *
'b Tyre.Internal.wit -> [ `Left of 'a | `Right of 'b ]
Tyre.Internal.wit
| Seq : 'a Tyre.Internal.wit *
'b Tyre.Internal.wit -> ('a * 'b) Tyre.Internal.wit
| Rep : 'a Tyre.Internal.wit * Re.re -> 'a Tyre.gen Tyre.Internal.wit
val build : 'a Tyre.Internal.raw -> int * 'a Tyre.Internal.wit * Re.t
val extract : 'a Tyre.Internal.wit -> int -> Re.substrings -> int * 'a
end
end