Copyright | (c) 2017-2019 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Various helpful functions to work with Text
Synopsis
- endLine :: Text
- packageToModule :: Text -> Text
- packageNameValid :: Text -> Bool
- moduleNameValid :: Text -> Bool
- intercalateMap :: Text -> (a -> Text) -> [a] -> Text
- headToUpper :: Text -> Text
- tconcatMap :: (a -> Text) -> [a] -> Text
Documentation
packageToModule :: Text -> Text Source #
Creates module name from the name of the package
Ex: my-lovely-project
— MyLovelyProject
packageNameValid :: Text -> Bool Source #
Decides whether the given text is a valid package name. Spec is here: https://www.haskell.org/cabal/users-guide/developing-packages.html#package-names-and-versions
moduleNameValid :: Text -> Bool Source #
Validate module name. It should be in the following formatTriple
Part1[.PartN]
intercalateMap :: Text -> (a -> Text) -> [a] -> Text Source #
Converts every element of list into Text
and then joins every element
into single Text
like intercalate
.
headToUpper :: Text -> Text Source #
tconcatMap :: (a -> Text) -> [a] -> Text Source #
Convert every element of a list into text, and squash the results