Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype InStr = InStr {}
- inStr'join :: InStr -> Str'Dynamic
- inStr'level :: InStr -> Natural
- inStr'dedent :: InStr -> InStr
- inStr'trim :: InStr -> InStr
- inStr'toList :: InStr -> [InStr'1]
- data InStr'1 = InStr'1 {}
- inStr'1'nonEmpty :: InStr'1 -> Bool
- inStr'1'empty :: InStr'1 -> Bool
- inStr'1'modifyLevel :: (Natural -> Natural) -> InStr'1 -> InStr'1
Indented string
An "indented string literal," delimited by two single-quotes ''
.
This type of literal is called "indented" because the parser automatically
removes leading whitespace from the string (inStr'dedent
), which makes it
convenient to use these literals for multi-line strings within an indented
expression without the whitespace from indentation ending up as part of the
string.
inStr'join :: InStr -> Str'Dynamic Source #
Join InStr
s with newlines interspersed.
inStr'level :: InStr -> Natural Source #
Determine how many characters of whitespace to strip from an indented string.
inStr'dedent :: InStr -> InStr Source #
Determine the minimum indentation of any nonempty line, and remove that many space characters from the front of every line.
inStr'trim :: InStr -> InStr Source #
Remove any empty lines from the beginning or end of an indented string.
inStr'toList :: InStr -> [InStr'1] Source #
Single line of an indented string
One line of an InStr
.
InStr'1 | |
|
inStr'1'nonEmpty :: InStr'1 -> Bool Source #
Determines whether an InStr'1
contains any non-space
characters. The opposite of inStr'1'nonEmpty
.
This is used to determine whether this line should be considered when
calculating the number of space characters to strip in inStr'dedent
.
inStr'1'empty :: InStr'1 -> Bool Source #
The opposite of inStr'1'nonEmpty
.