haskell-tools-ast-trf-0.1.2.0: Conversions on Haskell-Tools AST to prepare for refactorings

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.AnnTrf.SourceTemplateHelpers

Contents

Description

Helper functions for working with source templates

Synopsis

Documentation

filterList :: TemplateAnnot a => (Ann e a -> Bool) -> AnnList e a -> AnnList e a Source #

replaceList :: TemplateAnnot a => [Ann e a] -> AnnList e a -> AnnList e a Source #

Replaces the list with a new one with the given elements, keeping the most common separator as the new one.

insertWhere :: TemplateAnnot a => Ann e a -> (Maybe (Ann e a) -> Bool) -> (Maybe (Ann e a) -> Bool) -> AnnList e a -> AnnList e a 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 a) -> Bool) -> (Maybe (Ann e a) -> Bool) -> [Ann e a] -> Maybe Int Source #

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

class TemplateAnnot annot where Source #

Minimal complete definition

fromTemplate, getTemplate

(<>) :: SourceTemplate -> SourceTemplate -> SourceTemplate Source #

Concatenates two source templates to produce a new template with all child elements.

Orphan instances