diff options
author | Ben Sima <ben@bsima.me> | 2020-11-28 19:20:57 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-11-30 19:01:38 -0500 |
commit | c25390646bf9289dbba78a6d54f7e9a71fda3dc2 (patch) | |
tree | 14d1ef3dc4ffd33f1498fca52678d3a90097c6bf /Alpha.hs | |
parent | 46efb70b6a0970c5b1faf448ee2bae469d0f725f (diff) |
Use weekly branch names in pie, and small refactors
Diffstat (limited to 'Alpha.hs')
-rw-r--r-- | Alpha.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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" |