Skip to content

Commit

Permalink
Upgrade ocamlformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Oct 31, 2023
1 parent 6b72f2e commit af9ab4c
Show file tree
Hide file tree
Showing 2,183 changed files with 1,925 additions and 12,604 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.19.0
version=0.24.1
break-cases=toplevel
break-fun-decl=fit-or-vertical
break-infix=fit-or-vertical
Expand Down
1 change: 1 addition & 0 deletions .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/syntax.ml
6 changes: 0 additions & 6 deletions lib/aws.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,13 @@ module Signing = Signing

module type Call = sig
type input

type output

type error

val signature_version : Request.signature_version

val service : string

val to_http : string -> string -> input -> Request.t

val of_http : string -> [ `Ok of output | `Error of error Error.error_response ]

val parse_error : int -> string -> error option
end

Expand Down
17 changes: 0 additions & 17 deletions lib/aws.mli
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ module Time : sig
format. *)

val date_time_iso8601 : CalendarLib.Calendar.t -> string

val now_utc : unit -> CalendarLib.Calendar.t

val format : CalendarLib.Calendar.t -> string
Expand Down Expand Up @@ -291,11 +290,8 @@ end
module Signing : sig
module Hash : sig
val _sha256 : ?key:string -> string -> Digestif.SHA256.t

val sha256 : ?key:string -> string -> string

val sha256_hex : ?key:string -> string -> string

val sha256_base64 : ?key:string -> string -> string
end

Expand Down Expand Up @@ -352,34 +348,21 @@ module BaseTypes : sig
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

module Unit : Base with type t = unit

module String : Base with type t = string

module Blob : Base with type t = string

module Boolean : Base with type t = bool

module Integer : Base with type t = int

module Long : Base with type t = int

module Double : Base with type t = float

module Float : Base with type t = float

module DateTime : Base with type t = CalendarLib.Calendar.t
end

Expand Down
16 changes: 0 additions & 16 deletions lib/baseTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ module type Base = sig
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

Expand All @@ -27,11 +22,8 @@ module Unit = struct
| t -> raise (Json.Casting_error ("unit", t))

let to_query () = List []

let parse _ = Some () (* XXX(seliopou): Should never be used, maybe assert that? *)

let to_string _ = raise (Failure "unit")

let of_string _ = raise (Failure "unit")
end

Expand All @@ -45,11 +37,8 @@ module String = struct
| t -> raise (Json.Casting_error ("string", t))

let to_query s = Value (Some s)

let parse s = Some (data_to_string s)

let to_string s = s

let of_string s = s
end

Expand Down Expand Up @@ -106,7 +95,6 @@ module Integer = struct
| Some s -> ( try Some (int_of_string s) with Failure _ -> None)

let to_string i = string_of_int i

let of_string s = int_of_string s
end

Expand All @@ -129,7 +117,6 @@ module Float = struct
| Some s -> ( try Some (float_of_string s) with Failure _ -> None)

let to_string f = string_of_float f

let of_string s = float_of_string s
end

Expand All @@ -139,9 +126,7 @@ module DateTime = struct
type t = CalendarLib.Calendar.t

let to_json c = `String (Time.format c)

let of_json t = Time.parse (String.of_json t)

let to_query c = Value (Some (Time.format c))

let parse c =
Expand All @@ -150,6 +135,5 @@ module DateTime = struct
| Some s -> ( try Some (Time.parse s) with Invalid_argument _ -> None)

let to_string c = Time.format c

let of_string s = Time.parse s
end
Loading

0 comments on commit af9ab4c

Please sign in to comment.