summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-12-24 00:48:26 -0500
committerBen Sima <ben@bsima.me>2020-12-24 00:48:26 -0500
commit20aad0c282c0c3bd685863252b3c464b7d74a9e8 (patch)
tree1b13e6d812358ca164a3861ba3b830d21f508a3f /Alpha.hs
parent9acdd49be8c589cd766c81929599b00afb7a729d (diff)
hlint fixes
Still calibrating my use of hlint.
Diffstat (limited to 'Alpha.hs')
-rw-r--r--Alpha.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alpha.hs b/Alpha.hs
index 568229e..66bdb43 100644
--- a/Alpha.hs
+++ b/Alpha.hs
@@ -94,7 +94,7 @@ f </ g = fmap f g
-- (i.e. it goes "two levels deep"), applies the function to the inner
-- values, then returns the result wrapped in the two functors.
(<//) :: (Functor f0, Functor f1) => (a -> b) -> f0 (f1 a) -> f0 (f1 b)
-(<//) = fmap . fmap
+(<//) = fmap .> 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