summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-11-28 19:20:57 -0500
committerBen Sima <ben@bsima.me>2020-11-30 19:01:38 -0500
commitc25390646bf9289dbba78a6d54f7e9a71fda3dc2 (patch)
tree14d1ef3dc4ffd33f1498fca52678d3a90097c6bf /Alpha.hs
parent46efb70b6a0970c5b1faf448ee2bae469d0f725f (diff)
Use weekly branch names in pie, and small refactors
Diffstat (limited to 'Alpha.hs')
-rw-r--r--Alpha.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alpha.hs b/Alpha.hs
index 556f8df..f95d234 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -43,6 +43,9 @@ module Alpha
-- * String
capitalize,
+ -- * Data Validation
+ require,
+
-- * Debugging tools
say,
)
@@ -115,3 +118,7 @@ instance CanSnakeCase Text where
capitalize :: String -> String
capitalize [] = []
capitalize str = (Char.toUpper <| List.head str) : (Char.toLower </ List.tail str)
+
+require :: Text -> Maybe a -> a
+require _ (Just x) = x
+require s Nothing = panic <| s <> " not found"