| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Uniform.Strings
Description
a top module exporting the operations in the package
Synopsis
- module Uniform.Strings.Conversion
- module Uniform.Strings.Utilities
- (<:>) :: Text -> Text -> Text
- (<+>) :: Text -> Text -> Text
- (<->) :: Text -> Text -> Text
- (<#>) :: Text -> Text -> Text
- (<|>) :: Text -> Text -> Text
- wrapInSpitz :: Text -> Text
- wrapInDoubleQuotes :: Text -> Text
- wrapInBraces :: Text -> Text
- addXatEnd :: (IsString s, CharChains s) => s -> s -> s
- class IsString a where
- fromString :: String -> a
- type String = [Char]
- unlines :: [String] -> String
- lines :: String -> [String]
- unwords :: [String] -> String
- words :: String -> [String]
- putIOwords :: MonadIO m => [Text] -> m ()
- class NiceStrings a where
- class IsString a where
- fromString :: String -> a
- type family LF l
- class (Monoid l, Zeros (LF l)) => ListForms l where
- ppShowList :: (Foldable f, Show a) => f a -> String
- ppShow :: Show a => a -> String
Documentation
module Uniform.Strings.Conversion
module Uniform.Strings.Utilities
(<|>) :: Text -> Text -> Text Source #
append text with blank in between, (a character does not work as name) possible conflict with parsec
addXatEnd :: (IsString s, CharChains s) => s -> s -> s Source #
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
Methods
fromString :: String -> a #
Instances
lines breaks a string up into a list of strings at newline
characters. The resulting strings do not contain newlines.
Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,
>>>lines ""[]
>>>lines "\n"[""]
>>>lines "one"["one"]
>>>lines "one\n"["one"]
>>>lines "one\n\n"["one",""]
>>>lines "one\ntwo"["one","two"]
>>>lines "one\ntwo\n"["one","two"]
Thus contains at least as many elements as newlines in lines ss.
words breaks a string up into a list of words, which were delimited
by white space.
>>>words "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]
putIOwords :: MonadIO m => [Text] -> m () Source #
class NiceStrings a where Source #
Minimal complete definition
Nothing
Instances
| NiceStrings Double Source # | |
| NiceStrings Int Source # | |
| NiceStrings Text Source # | |
| NiceStrings a => NiceStrings [a] Source # | |
| NiceStrings a => NiceStrings (Maybe a) Source # | |
| (NiceStrings a, NiceStrings b) => NiceStrings (a, b) Source # | |
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
Methods
fromString :: String -> a #
Instances
Instances
| type LF String Source # | |
Defined in Uniform.Strings.Utilities | |
| type LF Text Source # | |
Defined in Uniform.Strings.Utilities | |
| type LF BSUTF Source # | |
Defined in Uniform.Strings.Utilities | |
| type LF LazyByteString Source # | |
Defined in Uniform.Strings.Utilities | |
class (Monoid l, Zeros (LF l)) => ListForms l where #
Minimal complete definition
Methods
prependOne :: LF l -> l -> l #
Instances
| ListForms String Source # | |
| ListForms Text Source # | |
| ListForms BSUTF Source # | |
| ListForms LazyByteString Source # | |
Defined in Uniform.Strings.Utilities Associated Types type LF LazyByteString # Methods prependOne :: LF LazyByteString -> LazyByteString -> LazyByteString # appendOne :: LazyByteString -> LF LazyByteString -> LazyByteString # mkOne :: LF LazyByteString -> LazyByteString # appendTwo :: LazyByteString -> LazyByteString -> LazyByteString # | |
ppShowList :: (Foldable f, Show a) => f a -> String #
Pretty print something that may be converted to a list as a list. Each entry is on a separate line, which means that we don't do clever pretty printing, and so this works well for large strucutures.