From c284fcd570342c31bc21169960579a20a763e32e Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Tue, 23 Jun 2026 23:53:26 -0300 Subject: Format --- lib/conventions.ml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'lib/conventions.ml') diff --git a/lib/conventions.ml b/lib/conventions.ml index 9e18762..70f33cf 100644 --- a/lib/conventions.ml +++ b/lib/conventions.ml @@ -15,8 +15,7 @@ end module Cardinality = struct open Sexplib.Std - type t = Finite of int | ConstrainedFinite | AlephZero | Continuum - [@@deriving sexp] + type t = Finite of int | ConstrainedFinite | AlephZero | Continuum [@@deriving sexp] end module Purity = struct @@ -27,8 +26,7 @@ module AbstractValue = struct type t = Obj.t type value_type = Int | String | Float | Opaque - let hash (elem : t) = - Sha256.to_hex (Sha256.string (Bytes.to_string (Marshal.to_bytes elem []))) + let hash (elem : t) = Sha256.to_hex (Sha256.string (Bytes.to_string (Marshal.to_bytes elem []))) let type_of (elem : t) : value_type = let tag = Obj.tag elem in @@ -43,17 +41,15 @@ module AbstractValue = struct | Int -> Atom (string_of_int (Obj.obj v : int)) | String -> Atom (Obj.obj v : string) | Float -> - let f = (Obj.obj v : float) in - if Float.is_nan f || Float.is_infinite f - then Atom "nan" - else Atom (string_of_float f) + let f = (Obj.obj v : float) in + if Float.is_nan f || Float.is_infinite f then Atom "nan" else Atom (string_of_float f) | Opaque -> Atom "" let equal a b = - match (type_of a, type_of b) with - | (Int, Int) -> (Obj.obj a : int) = (Obj.obj b : int) - | (String, String) -> (Obj.obj a : string) = (Obj.obj b : string) - | (Float, Float) -> (Obj.obj a : float) = (Obj.obj b : float) - | (Opaque, Opaque) -> false - | (_, _) -> false + match type_of a, type_of b with + | Int, Int -> (Obj.obj a : int) = (Obj.obj b : int) + | String, String -> (Obj.obj a : string) = (Obj.obj b : string) + | Float, Float -> (Obj.obj a : float) = (Obj.obj b : float) + | Opaque, Opaque -> false + | _, _ -> false end -- cgit v1.2.3