From bd375d4e684fd2a52a723bd2010d345ad2008f55 Mon Sep 17 00:00:00 2001 From: Bannerets Date: Sun, 15 Oct 2023 16:32:36 +0000 Subject: [PATCH] Remove interpret wrappers (i8, i16, etc.) --- CHANGES.md | 1 + src/interpret.ml | 65 ------------------------------------------------ src/kdl.mli | 40 ----------------------------- 3 files changed, 1 insertion(+), 105 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0793f59..4d78619 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/src/interpret.ml b/src/interpret.ml index 20eeeeb..62ef436 100644 --- a/src/interpret.ml +++ b/src/interpret.ml @@ -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 diff --git a/src/kdl.mli b/src/kdl.mli index 60373ec..6412ab8 100644 --- a/src/kdl.mli +++ b/src/kdl.mli @@ -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