summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-01-22 07:11:21 -0500
committerBen Sima <ben@bsima.me>2021-01-22 08:00:27 -0500
commit23ab6b0890626e7a6f081ca49aa1b5d3aea11887 (patch)
tree77f645d5149c13bfad781c7f60db44cc9c3881aa
parentf12a68cde2bd86496a82c532e848d273f4e49065 (diff)
Add lisp-ish list singleton function
-rw-r--r--Alpha.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Alpha.hs b/Alpha.hs
index 93308a0..c14f03f 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -55,6 +55,9 @@ module Alpha
capitalize,
lowercase,
+ -- * Lists
+ list,
+
-- * Data Validation
require,
@@ -69,7 +72,11 @@ import Data.String
import Data.Text (Text)
import qualified Data.Text as Text
import qualified Data.Text.Lazy as LazyText
-import Protolude as X hiding (($), (&), (.))
+import Protolude as X hiding (list, ($), (&), (.))
+
+-- | Create a list. This should be @Data.List.singleton@ but that doesn't exist.
+list :: a -> [a]
+list a = [a]
-- | Debugging printf
say :: Text -> IO ()