Minor cosmetic corrections

This commit is contained in:
mrkkrp 2016-10-04 10:40:29 +03:00
parent 5b718ca4f3
commit f3cdc38874
3 changed files with 3 additions and 3 deletions

View File

@ -47,5 +47,5 @@ camelizeCustom
-> Text -- ^ The camelized 'Text'
camelizeCustom _ [] = ""
camelizeCustom c (x:xs) = T.concat $
(mapWord (if c then T.toTitle else T.toLower) x) : (mapWord T.toTitle <$> xs)
mapWord (if c then T.toTitle else T.toLower) x : (mapWord T.toTitle <$> xs)
{-# INLINE camelizeCustom #-}

View File

@ -38,7 +38,7 @@ parameterizeCustom :: Transliterations -> Text -> Text
parameterizeCustom m txt = (T.intercalate "-" . T.words) (T.unfoldr f ("", txt))
where
f ("", t) = uncurry g <$> T.uncons t
f ((x:xs), t) = Just (x, (xs, t))
f (x:xs, t) = Just (x, (xs, t))
g x xs
| (isAscii x && isAlphaNum x) || x == '_' = (toLower x, ("", xs))
| isPunctuation x = (' ', ("", xs))

View File

@ -45,7 +45,7 @@ transliterateCustom
transliterateCustom replacement m txt = T.unfoldr f ("", txt)
where
f ("", t) = uncurry g <$> T.uncons t
f ((x:xs), t) = Just (x, (xs, t))
f (x:xs, t) = Just (x, (xs, t))
g x xs =
if isAscii x
then (x, ("", xs))