From 555a78d70ca3193f112d0026ea8db7706da989a7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 24 Oct 2024 20:57:19 +0100 Subject: [PATCH] refactor: rename constructor to variant --- lib/dyn.ml | 4 ++-- lib_test/expect/import.ml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dyn.ml b/lib/dyn.ml index 6f94e93..bbff0bf 100644 --- a/lib/dyn.ml +++ b/lib/dyn.ml @@ -3,10 +3,10 @@ type t = | Tuple of t list | Enum of string | List of t list - | Constructor of string * t list + | Variant of string * t list | Record of (string * t) list -let variant x y = Constructor (x, y) +let variant x y = Variant (x, y) let list x = List x let int x = Int x let pair x y = Tuple [ x; y ] diff --git a/lib_test/expect/import.ml b/lib_test/expect/import.ml index 0cfa66f..0ce14cf 100644 --- a/lib_test/expect/import.ml +++ b/lib_test/expect/import.ml @@ -66,8 +66,8 @@ let rec sexp_of_dyn (t : Re_private.Dyn.t) : Base.Sexp.t = | Tuple xs -> List (List.map xs ~f:sexp_of_dyn) | Enum s -> Atom s | List xs -> List (List.map ~f:sexp_of_dyn xs) - | Constructor (name, []) -> Atom name - | Constructor (name, xs) -> List (Atom name :: List.map xs ~f:sexp_of_dyn) + | Variant (name, []) -> Atom name + | Variant (name, xs) -> List (Atom name :: List.map xs ~f:sexp_of_dyn) | Record fields -> List (List.map fields ~f:(fun (name, v) -> Base.Sexp.List [ Atom name; sexp_of_dyn v ]))