From dd8f2b8629436a96a3c346b72907869bb79da633 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Thu, 9 Feb 2023 09:50:17 +0100 Subject: [PATCH] Clean up Nullable and Null --- src/Core__Null.res | 4 ++-- src/Core__Nullable.res | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Core__Null.res b/src/Core__Null.res index dc6e2fb5..2b9c0c9e 100644 --- a/src/Core__Null.res +++ b/src/Core__Null.res @@ -2,7 +2,7 @@ type t<'a> = Js.Null.t<'a> external asNullable: t<'a> => Core__Nullable.t<'a> = "%identity" -external empty: t<'a> = "#null" +external null: t<'a> = "#null" external make: 'a => t<'a> = "%identity" @@ -11,5 +11,5 @@ external toOption: t<'a> => option<'a> = "#null_to_opt" let fromOption: option<'a> => t<'a> = option => switch option { | Some(x) => make(x) - | None => empty + | None => null } diff --git a/src/Core__Nullable.res b/src/Core__Nullable.res index 2f3e9a2d..044a037b 100644 --- a/src/Core__Nullable.res +++ b/src/Core__Nullable.res @@ -4,8 +4,6 @@ external null: t<'a> = "#null" external undefined: t<'a> = "#undefined" -external empty: t<'a> = "#undefined" - external make: 'a => t<'a> = "%identity" external toOption: t<'a> => option<'a> = "#nullable_to_opt" @@ -13,5 +11,5 @@ external toOption: t<'a> => option<'a> = "#nullable_to_opt" let fromOption: option<'a> => t<'a> = option => switch option { | Some(x) => make(x) - | None => empty + | None => undefined }