Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Folding-related functions and types.
Synopsis
- data EnumType
- data WrapType
- data SepType
- data FoldType
- foldConstraints :: Quantity c => c -> [ConstraintE] -> Sentence
- foldlEnumList :: EnumType -> WrapType -> SepType -> FoldType -> [Sentence] -> Sentence
- foldlList :: SepType -> FoldType -> [Sentence] -> Sentence
- foldlSP :: [Sentence] -> Contents
- foldlSP_ :: [Sentence] -> Contents
- foldlSPCol :: [Sentence] -> Contents
- foldlSent :: [Sentence] -> Sentence
- foldlSent_ :: [Sentence] -> Sentence
- foldlSentCol :: [Sentence] -> Sentence
- foldlsC :: [Sentence] -> Sentence
- foldNums :: String -> [Int] -> Sentence
- numList :: String -> [Int] -> [String]
English-related Datatypes
For help working with listing information in English. Allows the below functions to make different kinds of lists based on the options defined here.
Type that helps determine enumeration method. Can use either numbers, uppercase letters, or lowercase letters.
Type to help wrap a sentence with parenthesis or to add a period at the end.
Type to help fold differently between listed items, or if there are options (ex. using "and" or "or" at the end of a list of words).
Folding Functions
Expression-related
foldConstraints :: Quantity c => c -> [ConstraintE] -> Sentence Source #
Helper for formatting a list of constraints.
Sentence-related
foldlEnumList :: EnumType -> WrapType -> SepType -> FoldType -> [Sentence] -> Sentence Source #
Creates a list of elements with "enumerators" in "wrappers" using foldlList.
foldlList :: SepType -> FoldType -> [Sentence] -> Sentence Source #
Creates a list of elements separated by a "separator", ending with "and" or "or".
foldlSPCol :: [Sentence] -> Contents Source #
Same as foldlSP
but uses foldlSentCol
.
foldlSent :: [Sentence] -> Sentence Source #
Partial function application of foldle
for sentences specifically.
Folds with spaces and adds a period (".") at the end.
foldlsC :: [Sentence] -> Sentence Source #
Folds a list of elements separated by commas, including the last element.