drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Sentence.Fold

Description

Folding-related functions and types.

Synopsis

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.

data EnumType Source #

Type that helps determine enumeration method. Can use either numbers, uppercase letters, or lowercase letters.

Constructors

Numb 
Upper 
Lower 

data WrapType Source #

Type to help wrap a sentence with parenthesis or to add a period at the end.

Constructors

Parens 
Period 

data SepType Source #

Type to help separate words with commas or semicolons.

Constructors

Comma 
SemiCol 

data FoldType Source #

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).

Constructors

List 
Options 

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".

foldlSP :: [Sentence] -> Contents Source #

Fold sentences then turns into content using foldlSent.

foldlSent :: [Sentence] -> Sentence Source #

Partial function application of foldle for sentences specifically. Folds with spaces and adds a period (".") at the end.

foldlSent_ :: [Sentence] -> Sentence Source #

foldlSent but does not add a period.

foldlSentCol :: [Sentence] -> Sentence Source #

foldlSent but ends with colon.

foldlsC :: [Sentence] -> Sentence Source #

Folds a list of elements separated by commas, including the last element.

foldNums :: String -> [Int] -> Sentence Source #

Parses a list of integers into a nice sentence (ie. S "1, 4-7, and 13").

numList :: String -> [Int] -> [String] Source #

Parses a list of integers into a list of strings (ie. ["1", "4-7", "13"]).