summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-07-07 18:57:04 -0400
committerBen Sima <ben@bsima.me>2021-11-26 13:47:36 -0500
commit1934482e8a5beb628b1e6e9db11f9fd274f174a5 (patch)
tree4047135e1adc49986197b59ccb02d374d48f801d /Alpha.hs
parent75a804d52461aade2e4431a2148eabcd99a9e26e (diff)
Factor Analysis into own module
Diffstat (limited to 'Alpha.hs')
-rw-r--r--Alpha.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Alpha.hs b/Alpha.hs
index 6245614..1da1f1a 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -66,6 +66,7 @@ module Alpha
-- * String
capitalize,
lowercase,
+ strip,
-- * Lists
list,
@@ -184,6 +185,10 @@ _ ?+ [] = panic "wutlus: empty cond list"
(?<) :: Bool -> (Bool -> Text -> a) -> Text -> a
a ?< f = if not a then f a else panic "wutgal failed"
+-- | Removes newlinse from a string.
+strip :: String -> String
+strip = filter (/= '\n')
+
-- | Removes newlines from text.
chomp :: Text -> Text
chomp = Text.filter (/= '\n')