Safe Haskell | None |
---|---|

Language | Haskell2010 |

Functions for manipulating nix strings.

## Synopsis

- mergePlain :: [Antiquoted Text r] -> [Antiquoted Text r]
- removePlainEmpty :: [Antiquoted Text r] -> [Antiquoted Text r]
- runAntiquoted :: v -> (v -> a) -> (r -> a) -> Antiquoted v r -> a
- splitLines :: [Antiquoted Text r] -> [[Antiquoted Text r]]
- unsplitLines :: [[Antiquoted Text r]] -> [Antiquoted Text r]
- stripIndent :: [Antiquoted Text r] -> NString r
- escapeCodes :: [(Char, Char)]
- fromEscapeCode :: Char -> Maybe Char
- toEscapeCode :: Char -> Maybe Char

# Documentation

mergePlain :: [Antiquoted Text r] -> [Antiquoted Text r] Source #

removePlainEmpty :: [Antiquoted Text r] -> [Antiquoted Text r] Source #

runAntiquoted :: v -> (v -> a) -> (r -> a) -> Antiquoted v r -> a Source #

Equivalent to case splitting on `Antiquoted`

strings.

splitLines :: [Antiquoted Text r] -> [[Antiquoted Text r]] Source #

Split a stream representing a string with antiquotes on line breaks.

unsplitLines :: [[Antiquoted Text r]] -> [Antiquoted Text r] Source #

Join a stream of strings containing antiquotes again. This is the inverse
of `splitLines`

.

stripIndent :: [Antiquoted Text r] -> NString r Source #

Form an indented string by stripping spaces equal to the minimal indent.

escapeCodes :: [(Char, Char)] Source #