Safe Haskell | None |
---|---|
Language | Haskell2010 |
Defines operation on AST lists. AST lists carry source information so simple list modification is not enough.
- filterList :: (Ann e dom SrcTemplateStage -> Bool) -> AnnList e dom -> AnnList e dom
- filterListIndexed :: (Int -> Ann e dom SrcTemplateStage -> Bool) -> AnnList e dom -> AnnList e dom
- insertWhere :: Ann e dom SrcTemplateStage -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> AnnList e dom -> AnnList e dom
- insertIndex :: (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> (Maybe (Ann e dom SrcTemplateStage) -> Bool) -> [Ann e dom SrcTemplateStage] -> Maybe Int
- zipWithSeparators :: AnnList e dom -> [(String, Ann e dom SrcTemplateStage)]
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.