haskell-tools-refactor-0.5.0.0: Refactoring Tool for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor.ListOperations

Description

Defines operation on AST lists. AST lists carry source information so simple list modification is not enough.

Synopsis

Documentation

filterList :: (Ann e dom SrcTemplateStage -> Bool) -> AnnList e dom -> AnnList e dom Source #

Filters the elements of the list. By default it removes the separator before the element. Of course, if the first element is removed, the following separator is removed as well.

filterListIndexed :: (Int -> Ann e dom SrcTemplateStage -> Bool) -> AnnList e dom -> AnnList e dom Source #

insertWhere :: Ann e dom SrcTemplateStage -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> AnnList e dom -> AnnList e dom Source #

Inserts the element in the places where the two positioning functions (one checks the element before, one the element after) allows the placement.

insertIndex :: (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> [Ann e dom SrcTemplateStage] -> Maybe Int Source #

Checks where the element will be inserted given the two positioning functions.

zipWithSeparators :: AnnList e dom -> [(String, Ann e dom SrcTemplateStage)] Source #

Gets the elements and separators from a list. The first separator is zipped to the second element. To the first element, the "" string is zipped.