libhbb-0.4.1.0: Backend for text editors to provide better Haskell editing support.

Safe HaskellNone

Language.Haskell.HBB.Internal.TTree

Synopsis

Documentation

data TTreeNode a b Source

Constructors

Addition a 
Display b 

Instances

(Eq a, Eq b) => Eq (TTreeNode a b) 
(Show a, Show b) => Show (TTreeNode a b) 

data TTree a b c Source

This is the generic data structure representing a transformation tree.

TransformationTree

The transformation tree is a recursive data structure to represent modifications to text (files). It is used to represent the changes to source code made by the inlining function feature.

Cover-Range

The cover-range is the snippet of code that should be hidden by the new text. For the root of the tree this is a RealSrcSpan (which has a filename attached). For other location the cover-range refers to the text inserted by the parent element.

Children

The text that has been added by for example an addition may be altered again by the usage of nested transformations. These transformations always refer to their parent transformation whichs means that the Cover-Range for example contains lines- and column-indices which refer only to the snipped added by their parent transformation (and not the whole text which is referred to by the top-most addition or display). INVARIANT: Moreover the source-spans elements of child-transformations must be disjoint. Reassembling the transformation-tree can so be done by sorting the child-tranformations by their cover-range in reverse order (so that the last position is taken first) and applying them.

Instance of TTree produced by ConvertibleToTTree:

 TTree LineBuf RealSrcSpan InsertionInfo

Instance of TTree that is searialized to JSON:

 TTree LineBuf (RealSrcSpan,Int) BufSpan

Constructors

TTree (TTreeNode a b) [(c, TTree a b c)] 

Instances

(Eq a, Eq b, Eq c) => Eq (TTree a b c) 
(Show a, Show b, Show c) => Show (TTree a b c) 

applyTTreeGeneric :: Maybe (a, attr -> a, (a, attr) -> (LineBuf, LineBuf, LineBuf) -> (LineBuf, LineBuf, LineBuf)) -> [(FilePath, LineBuf)] -> (attr -> BufSpan) -> (attr, TTree LineBuf (RealSrcSpan, Int) attr) -> LineBuf -> LineBufSource

getCacheElement :: FilePath -> [(FilePath, LineBuf)] -> LineBufSource

collectFilenames :: (a, TTree b (RealSrcSpan, Int) a) -> [FilePath]Source

cacheFiles :: [FilePath] -> IO [(FilePath, LineBuf)]Source