pandoc-filter-indent-0.3.3.0: Pandoc filter formatting Haskell code fragments using GHC lexer.
Safe HaskellNone
LanguageHaskell2010

Util

Description

Shared utilities that may be moved to upstream libraries.

Synopsis

Documentation

maybeLens :: a -> Lens (Maybe a) (Maybe a1) a a1 Source #

Lens with default value.

grouping :: Ord k => (a -> k) -> [a] -> [[a]] Source #

Sort and group inputs by a given Ordering.

nubSorted :: Ord a => [a] -> [a] Source #

Sort and remove duplicates in a list. Duplicates are detected as equals by default Ordering.

nubSortedBy :: (a -> a -> Ordering) -> [a] -> [a] Source #

Given an Ordering, sort and remove duplicates.

safeTail :: [a] -> [a] Source #

Safe tail function that returns empty list for empty input.

unbrace :: Text -> Maybe Text Source #

Take text in braces, and return its inner part. Fail if the given text does not start with opening brace, and end in closing brace.

brace :: (Monoid a, IsString a) => a -> a Source #

preformatTokens :: (Eq b, IsString b) => [(MyTok, b)] -> [(MyTok, b)] Source #

Preprocess tokens before formatting in order to detect tokens like functions converted to operator syntax. These are merged into a single token.