mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
reindent code
This commit is contained in:
parent
6ec2fdeb1e
commit
ddf709fc5b
5 changed files with 14 additions and 14 deletions
|
|
@ -33,12 +33,12 @@ val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
|
||||||
(** Reverse the order of arguments for a binary function. *)
|
(** Reverse the order of arguments for a binary function. *)
|
||||||
|
|
||||||
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
|
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
|
||||||
(** Convert a function which accepts a pair of arguments into a function which accepts two arguments.
|
(** Convert a function which accepts a pair of arguments into a function which accepts two arguments.
|
||||||
[curry f x y] is [f (x,y)]. *)
|
[curry f x y] is [f (x,y)]. *)
|
||||||
|
|
||||||
val uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c
|
val uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c
|
||||||
(** Convert a function which accepts a two arguments into a function which accepts a pair of arguments.
|
(** Convert a function which accepts a two arguments into a function which accepts a pair of arguments.
|
||||||
[uncurry f (x,y)] is [f x y]. *)
|
[uncurry f (x,y)] is [f x y]. *)
|
||||||
|
|
||||||
val tap : ('a -> _) -> 'a -> 'a
|
val tap : ('a -> _) -> 'a -> 'a
|
||||||
(** [tap f x] evaluates [f x], discards it, then returns [x]. Useful
|
(** [tap f x] evaluates [f x], discards it, then returns [x]. Useful
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ module Infix : sig
|
||||||
val (<+>) : 'a t -> 'a t -> 'a t
|
val (<+>) : 'a t -> 'a t -> 'a t
|
||||||
(** [a <+> b] is [a] if [a] is [Some _], [b] otherwise. *)
|
(** [a <+> b] is [a] if [a] is [Some _], [b] otherwise. *)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
(** {2 Conversion and IO} *)
|
(** {2 Conversion and IO} *)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ module Infix : sig
|
||||||
in case of success, applies [f] to the result. *)
|
in case of success, applies [f] to the result. *)
|
||||||
|
|
||||||
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
|
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
|
||||||
(** Applicative. *)
|
(** Applicative. *)
|
||||||
|
|
||||||
val (<* ) : 'a t -> _ t -> 'a t
|
val (<* ) : 'a t -> _ t -> 'a t
|
||||||
(** [a <* b] parses [a] into [x], parses [b] and ignores its result,
|
(** [a <* b] parses [a] into [x], parses [b] and ignores its result,
|
||||||
|
|
@ -382,10 +382,10 @@ module Infix : sig
|
||||||
|
|
||||||
val (<|>) : 'a t -> 'a t -> 'a t
|
val (<|>) : 'a t -> 'a t -> 'a t
|
||||||
(** [a <|> b] tries to parse [a], and if [a] fails without
|
(** [a <|> b] tries to parse [a], and if [a] fails without
|
||||||
consuming any input, backtracks and tries
|
consuming any input, backtracks and tries
|
||||||
to parse [b], otherwise it fails as [a].
|
to parse [b], otherwise it fails as [a].
|
||||||
See {!try_} to ensure [a] does not consume anything (but it is best
|
See {!try_} to ensure [a] does not consume anything (but it is best
|
||||||
to avoid wrapping large parsers with {!try_}). *)
|
to avoid wrapping large parsers with {!try_}). *)
|
||||||
|
|
||||||
val (<?>) : 'a t -> string -> 'a t
|
val (<?>) : 'a t -> string -> 'a t
|
||||||
(** [a <?> msg] behaves like [a], but if [a] fails without
|
(** [a <?> msg] behaves like [a], but if [a] fails without
|
||||||
|
|
|
||||||
|
|
@ -167,12 +167,12 @@ module Infix : sig
|
||||||
|
|
||||||
val (>>=) : ('a, 'err) t -> ('a -> ('b, 'err) t) -> ('b, 'err) t
|
val (>>=) : ('a, 'err) t -> ('a -> ('b, 'err) t) -> ('b, 'err) t
|
||||||
(** Monadic composition. [e >>= f] proceeds as [f x] if [e] is [Ok x]
|
(** Monadic composition. [e >>= f] proceeds as [f x] if [e] is [Ok x]
|
||||||
or returns [e] if [e] is an [Error]. *)
|
or returns [e] if [e] is an [Error]. *)
|
||||||
|
|
||||||
val (<*>) : ('a -> 'b, 'err) t -> ('a, 'err) t -> ('b, 'err) t
|
val (<*>) : ('a -> 'b, 'err) t -> ('a, 'err) t -> ('b, 'err) t
|
||||||
(** [a <*> b] evaluates [a] and [b], and, in case of success, returns
|
(** [a <*> b] evaluates [a] and [b], and, in case of success, returns
|
||||||
[Ok (a b)]. Otherwise, it fails, and the error of [a] is chosen
|
[Ok (a b)]. Otherwise, it fails, and the error of [a] is chosen
|
||||||
over the error of [b] if both fail. *)
|
over the error of [b] if both fail. *)
|
||||||
end
|
end
|
||||||
|
|
||||||
(** {2 Collections} *)
|
(** {2 Collections} *)
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ module type S = sig
|
||||||
val of_seq : elt sequence -> t
|
val of_seq : elt sequence -> t
|
||||||
(** Build a set from the given [sequence] of elements. *)
|
(** Build a set from the given [sequence] of elements. *)
|
||||||
|
|
||||||
val add_seq : t -> elt sequence -> t
|
val add_seq : t -> elt sequence -> t
|
||||||
(** @since 0.14 *)
|
(** @since 0.14 *)
|
||||||
|
|
||||||
val to_seq : t -> elt sequence
|
val to_seq : t -> elt sequence
|
||||||
|
|
@ -68,7 +68,7 @@ module type S = sig
|
||||||
val pp :
|
val pp :
|
||||||
?start:string -> ?stop:string -> ?sep:string ->
|
?start:string -> ?stop:string -> ?sep:string ->
|
||||||
elt printer -> t printer
|
elt printer -> t printer
|
||||||
(** Print the set *)
|
(** Print the set *)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue