summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Alpha.hs')
-rw-r--r--Alpha.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Alpha.hs b/Alpha.hs
index f95d234..5e41649 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -42,6 +42,7 @@ module Alpha
-- * String
capitalize,
+ lowercase,
-- * Data Validation
require,
@@ -119,6 +120,8 @@ capitalize :: String -> String
capitalize [] = []
capitalize str = (Char.toUpper <| List.head str) : (Char.toLower </ List.tail str)
+lowercase str = [Char.toLower c | c <- str]
+
require :: Text -> Maybe a -> a
require _ (Just x) = x
require s Nothing = panic <| s <> " not found"