haskell-tools-ast-trf-0.2.0.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

replaceList :: [Ann e dom SrcTemplateStage] -> AnnList e dom SrcTemplateStage -> AnnList e dom SrcTemplateStage Source #

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

insertWhere :: Ann e dom SrcTemplateStage -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> AnnList e dom SrcTemplateStage -> AnnList e dom SrcTemplateStage 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.

(<>) :: SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage Source #

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

Orphan instances