From 3b0eaae19dd4823107014a2dcc9b5469ca4c9edc Mon Sep 17 00:00:00 2001 From: ariel Date: Fri, 25 Apr 2025 15:15:20 -0400 Subject: [PATCH] Revert "types.optional (#114)" This reverts commit a4b51fdd5ccd0d1a1985fbfa97cf37492ca3684e. --- docs/types-library-optional.md | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 docs/types-library-optional.md diff --git a/docs/types-library-optional.md b/docs/types-library-optional.md deleted file mode 100644 index 1a1bf30..0000000 --- a/docs/types-library-optional.md +++ /dev/null @@ -1,19 +0,0 @@ -# types.optional - -## Summary - -This RFC proposes adding a new method to the `types` library in type functions, that provides a shorthand for `types.unionof(type, types.singleton(nil))`. - -## Motivation - -Optional types occur very commonly, and it is annoying to have to always type `types.unionof(meow, types.singleton(nil))` to make a optional type, this leads to having the following appear in codebases that make use of optional types a lot in type functions: - -```luau -type function optional(type) - return types.unionof(type, types.singleton(nil)) -end -``` - -## Design - -As a solution, a new method to the `types` library should be added called `optional`. This new method will act the same as `types.unionof(type, types.singleton(nil))`.