style: reindent

This commit is contained in:
Simon Cruanes 2018-03-28 19:46:57 -05:00
parent b874ff9bf9
commit 972a6f2720
8 changed files with 77 additions and 77 deletions

View file

@ -84,7 +84,7 @@ let rev s =
(*$Q
Q.printable_string (fun s -> \
rev s = (to_list s |> List.rev |> of_list))
*)
*)
(*$=

View file

@ -237,7 +237,7 @@ let of_string s = if is_valid s then Some s else None
let printer s = String.escaped (to_string s)
let pp_uchar (c:Uchar.t) = Printf.sprintf "0x%x" (Uchar.to_int c)
let uutf_is_valid s =
let uutf_is_valid s =
try
Uutf.String.fold_utf_8
(fun () _ -> function
@ -248,7 +248,7 @@ let uutf_is_valid s =
with Exit ->
false
let uutf_to_seq s f =
let uutf_to_seq s f =
Uutf.String.fold_utf_8
(fun () _ -> function
| `Malformed _ -> f (Uchar.of_int 0xfffd)
@ -331,4 +331,4 @@ let uutf_to_seq s f =
else Q.Test.fail_reportf "uutf: '%s', containers: '%s', is_valid %B, uutf_is_valid %B"
(pp l_uutf) (pp l_co) (is_valid s) (uutf_is_valid s)
)
*)
*)

View file

@ -19,8 +19,8 @@ type 'a printer = Format.formatter -> 'a -> unit
type 'a ktree = unit -> [`Nil | `Node of 'a * 'a ktree list]
(* TODO
(** {2 Transient IDs} *)
module Transient = struct
(** {2 Transient IDs} *)
module Transient = struct
type state = { mutable frozen: bool }
type t = Nil | St of state
let empty = Nil
@ -39,8 +39,8 @@ module Transient = struct
freeze r;
raise e
exception Frozen
end
*)
end
*)
(* function array *)
module A = struct
@ -133,7 +133,7 @@ type 'a t = {
(forall j>=i, sub[j].size<32^{n+1}-1)]
(prefix of subs has size of complete binary tree; suffix has
smaller size (actually decreasing))
*)
*)
let empty = {size=0; leaves=A.empty; subs=A.empty}
@ -290,7 +290,7 @@ let rec map f m : _ t =
let f = Q.Fn.apply f in
(List.map f l) = (of_list l |> map f |> to_list)
)
*)
*)
let append a b =
if is_empty b then a
@ -300,7 +300,7 @@ let append a b =
Q.(pair (small_list int)(small_list int)) (fun (l1,l2) ->
(l1 @ l2) = (append (of_list l1)(of_list l2) |> to_list)
)
*)
*)
let add_list v l = List.fold_left (fun v x -> push x v) v l

View file

@ -16,8 +16,8 @@ type 'a printer = Format.formatter -> 'a -> unit
type 'a ktree = unit -> [`Nil | `Node of 'a * 'a ktree list]
(* TODO: restore this
(** {2 Transient Identifiers} *)
module Transient : sig
(** {2 Transient Identifiers} *)
module Transient : sig
type t
(** Identifiers for transient modifications. A transient modification
is uniquely identified by a [Transient.t]. Once [Transient.freeze r]
@ -46,7 +46,7 @@ module Transient : sig
exception Frozen
(** Raised when a frozen ID is used. *)
end
end
*)
(** {2 Signature} *)
@ -92,19 +92,19 @@ val choose : 'a t -> 'a option
(* TODO
val push_mut : id:Transient.t -> 'a -> 'a t -> 'a t
(** [add_mut ~id k v m] behaves like [add k v m], except it will mutate
val push_mut : id:Transient.t -> 'a -> 'a t -> 'a t
(** [add_mut ~id k v m] behaves like [add k v m], except it will mutate
in place whenever possible. Changes done with an [id] might affect all
versions of the structure obtained with the same [id] (but not
other versions).
@raise Transient.Frozen if [id] is frozen. *)
val pop_mut : id:Transient.t -> 'a t -> 'a * 'a t
(** Same as {!remove}, but modifies in place whenever possible.
val pop_mut : id:Transient.t -> 'a t -> 'a * 'a t
(** Same as {!remove}, but modifies in place whenever possible.
@raise Transient.Frozen if [id] is frozen. *)
val append_mut : id:Transient.t -> into:'a t -> 'a t -> 'a t
*)
val append_mut : id:Transient.t -> into:'a t -> 'a t -> 'a t
*)
(** {6 Conversions} *)
@ -128,15 +128,15 @@ val to_gen : 'a t -> 'a gen
(* TODO
val add_list_mut : id:Transient.t -> 'a t -> 'a list -> 'a t
(** @raise Frozen if the ID is frozen. *)
val add_list_mut : id:Transient.t -> 'a t -> 'a list -> 'a t
(** @raise Frozen if the ID is frozen. *)
val add_seq_mut : id:Transient.t -> 'a t -> 'a sequence -> 'a t
(** @raise Frozen if the ID is frozen. *)
val add_seq_mut : id:Transient.t -> 'a t -> 'a sequence -> 'a t
(** @raise Frozen if the ID is frozen. *)
val add_gen_mut : id:Transient.t -> 'a t -> 'a gen -> 'a t
(** @raise Frozen if the ID is frozen. *)
*)
val add_gen_mut : id:Transient.t -> 'a t -> 'a gen -> 'a t
(** @raise Frozen if the ID is frozen. *)
*)
(** {6 IO} *)