Skip to content

Commit

Permalink
Remove interpret wrappers (i8, i16, etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
eilvelia committed Oct 15, 2023
1 parent 54da4e2 commit bd375d4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 105 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
newlines) is removed after `\`
- - Identifiers cannot start with `r#` anymore
- `interpret` now raises `Invalid_annotation` instead of `Failure`.
- `i8`, `i16`, etc. wrappers over `interpret` are removed.
- Dropped support for OCaml < 4.10.0

## 0.1.0 (2022-10-01)
Expand Down
65 changes: 0 additions & 65 deletions src/interpret.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,68 +112,3 @@ let interpret : annot_value -> [> typed_value] =

| Some annot, value -> `Other (annot, value)
| None, value -> `Unannotated value

let i8 annot_value =
match interpret annot_value with
| `I8 i -> Some i
| _ -> None

let i16 annot_value =
match interpret annot_value with
| `I16 i -> Some i
| _ -> None

let i32 annot_value =
match interpret annot_value with
| `I32 i -> Some i
| _ -> None

let i64 annot_value =
match interpret annot_value with
| `I64 i -> Some i
| _ -> None

let u8 annot_value =
match interpret annot_value with
| `U8 i -> Some i
| _ -> None

let u16 annot_value =
match interpret annot_value with
| `U16 i -> Some i
| _ -> None

let u32 annot_value =
match interpret annot_value with
| `U32 i -> Some i
| _ -> None

let u64 annot_value =
match interpret annot_value with
| `U64 i -> Some i
| _ -> None

let isize annot_value =
match interpret annot_value with
| `Isize i -> Some i
| _ -> None

let usize annot_value =
match interpret annot_value with
| `Usize i -> Some i
| _ -> None

let f32 annot_value =
match interpret annot_value with
| `F32 i -> Some i
| _ -> None

let f64 annot_value =
match interpret annot_value with
| `F64 i -> Some i
| _ -> None

let base64 annot_value =
match interpret annot_value with
| `Base64 b -> Some b
| _ -> None
40 changes: 0 additions & 40 deletions src/kdl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -192,46 +192,6 @@ val interpret : annot_value -> [> typed_value]
is annotated as "u8" but exceeds the range of u8, [Invalid_annotation] is
raised. *)

val i8 : annot_value -> int option
(** Interpret a value with the "i8" type annotation as [int]. *)

val i16 : annot_value -> int option
(** Interpret a value with the "i16" type annotation as [int]. *)

val i32 : annot_value -> int32 option
(** Interpret a value with the "i32" type annotation as [int32]. *)

val i64 : annot_value -> int64 option
(** Interpret a value with the "i64" type annotation as [int64]. *)

val u8 : annot_value -> int option
(** Interpret a value with the "u8" type annotation as [int]. *)

val u16 : annot_value -> int option
(** Interpret a value with the "u16" type annotation as [int]. *)

val u32 : annot_value -> int32 option
(** Interpret a value with the "u32" type annotation as [int32]. *)

val u64 : annot_value -> int64 option
(** Interpret a value with the "u64" type annotation as [int64]. *)

val isize : annot_value -> nativeint option
(** Interpret a value with the "isize" type annotation as [nativeint]. *)

val usize : annot_value -> nativeint option
(** Interpret a value with the "usize" type annotation as [nativeint]. *)

val f32 : annot_value -> float option
(** Interpret a value with the "f32" type annotation as [float]. *)

val f64 : annot_value -> float option
(** Interpret a value with the "f64" type annotation as [float]. *)

val base64 : annot_value -> bytes option
(** Interpret a value with the "base64" type annotation,
decoding the base64 string into [bytes]. *)

(** {1 Lenses} *)

module L : sig
Expand Down

0 comments on commit bd375d4

Please sign in to comment.