From 20aad0c282c0c3bd685863252b3c464b7d74a9e8 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 24 Dec 2020 00:48:26 -0500 Subject: hlint fixes Still calibrating my use of hlint. --- Alpha.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Alpha.hs') diff --git a/Alpha.hs b/Alpha.hs index 568229e..66bdb43 100644 --- a/Alpha.hs +++ b/Alpha.hs @@ -94,7 +94,7 @@ f (a -> b) -> f0 (f1 a) -> f0 (f1 b) -( fmap -- | Normal function application. Do the right side, then pass the -- return value to the function on the left side. @@ -138,7 +138,7 @@ class CanSnakeCase str where snake :: str -> str instance CanSnakeCase Text where - snake = Text.replace " " "-" . Text.toLower + snake = Text.toLower .> Text.replace " " "-" capitalize :: String -> String capitalize [] = [] @@ -153,13 +153,13 @@ require s Nothing = panic <| s <> " not found" -- | Wrap text at the given limit. wrap :: Int -> Text -> Text -wrap lim = Text.unwords . wrap_ 0 . Text.words +wrap lim = Text.words .> wrap_ 0 .> Text.unwords where wrap_ :: Int -> [Text] -> [Text] wrap_ _ [] = [] - wrap_ pos (w:ws) - | pos == 0 = w : (wrap_ (pos + lw) ws) + wrap_ pos (w : ws) + | pos == 0 = w : wrap_ (pos + lw) ws | pos + lw + 1 > lim = wrap_ 0 (Text.cons '\n' w : ws) - | otherwise = [w] ++ wrap_ (pos + lw + 1) ws + | otherwise = w : wrap_ (pos + lw + 1) ws where lw = Text.length w -- cgit v1.2.3