License | GPL-2 |
---|---|
Maintainer | yi-devel@googlegroups.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions | OverloadedStrings |
String manipulation utilities
Synopsis
- isBlank :: YiString -> Bool
- chomp :: String -> String -> String
- capitalize :: String -> String
- capitalizeFirst :: YiString -> YiString
- dropSpace :: String -> String
- fillText :: Int -> YiString -> [YiString]
- onLines :: ([YiString] -> [YiString]) -> YiString -> YiString
- mapLines :: (YiString -> YiString) -> YiString -> YiString
- lines' :: Text -> [Text]
- unlines' :: [Text] -> Text
- padLeft :: Int -> String -> String
- padRight :: Int -> String -> String
- commonTPrefix :: [Text] -> Maybe Text
- commonTPrefix' :: [Text] -> Text
- listify :: [YiString] -> YiString
- showT :: Show a => a -> Text
- overInit :: (YiString -> YiString) -> YiString -> YiString
- overTail :: (YiString -> YiString) -> YiString -> YiString
Documentation
chomp :: String -> String -> String Source #
Remove any trailing strings matching irs (input record separator) from input string. Like Perl's chomp(1).
capitalize :: String -> String Source #
capitalizeFirst :: YiString -> YiString Source #
fillText :: Int -> YiString -> [YiString] Source #
Fills lines up to the given length, splitting the text up if necessary.
mapLines :: (YiString -> YiString) -> YiString -> YiString Source #
A helper function for creating functions suitable for
modifySelectionB
and modifyRegionB
.
To be used when the desired function should map across
the lines of a region.
lines' :: Text -> [Text] Source #
Split a Text in lines. Unlike lines
, this does not
remove any empty line at the end.
commonTPrefix :: [Text] -> Maybe Text Source #
Works by resupplying the found prefix back into the list, eventually either finding the prefix or not matching.
commonTPrefix' :: [Text] -> Text Source #
Like commonTPrefix
but returns empty text on failure.
showT :: Show a => a -> Text Source #
Helper that shows then packs the Text
, for all those cases
where we use show
.