summaryrefslogtreecommitdiff
path: root/Alpha.hs
diff options
context:
space:
mode:
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