From 1934482e8a5beb628b1e6e9db11f9fd274f174a5 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 7 Jul 2021 18:57:04 -0400 Subject: Factor Analysis into own module --- Alpha.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Alpha.hs') 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') -- cgit v1.2.3