hnix-0.3.4: Haskell implementation of the Nix language

Safe HaskellNone
LanguageHaskell2010

Nix.StringOperations

Description

Functions for manipulating nix strings.

Synopsis

Documentation

mergePlain :: Monoid v => [Antiquoted v r] -> [Antiquoted v r] Source #

Merge adjacent Plain values with mappend.

removePlainEmpty :: (Eq v, Monoid v) => [Antiquoted v r] -> [Antiquoted v r] Source #

Remove Plain values equal to mempty, as they don't have any informational content.

runAntiquoted :: (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.