diff options
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" |