yi-core-0.14.0: Yi editor core library

LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • Cpp
  • ScopedTypeVariables
  • OverloadedStrings
  • DeriveFoldable
  • TypeSynonymInstances
  • FlexibleInstances
  • ExplicitForAll

Yi.Syntax.Tree

Description

 

Synopsis

Documentation

class Foldable tree => IsTree tree where #

Minimal complete definition

uniplate, emptyNode

Methods

subtrees :: tree t -> [tree t] #

Direct subtrees of a tree

uniplate :: tree t -> ([tree t], [tree t] -> tree t) #

emptyNode :: tree t #

Instances

IsTree Tree # 

Methods

subtrees :: Tree t -> [Tree t] #

uniplate :: Tree t -> ([Tree t], [Tree t] -> Tree t) #

emptyNode :: Tree t #

toksAfter :: Foldable t1 => t -> t1 a -> [a] #

allToks :: Foldable t => t a -> [a] #

tokAtOrBefore :: Foldable t => Point -> t (Tok t1) -> Maybe (Tok t1) #

toksInRegion :: Foldable t1 => Region -> t1 (Tok t) -> [Tok t] #

sepBy :: Alternative f => f a -> f v -> f [a] #

sepBy1 :: Alternative f => f a -> f v -> f [a] #

getLastOffset :: Foldable t => t (Tok t1) -> Point #

getFirstOffset :: Foldable t => t (Tok t1) -> Point #

getFirstElement :: Foldable t => t a -> Maybe a #

Return the 1st token of a subtree.

getLastElement :: Foldable t => t a -> Maybe a #

Return the last token of a subtree.

getLastPath :: IsTree tree => [tree (Tok t)] -> Point -> Maybe [tree (Tok t)] #

Search the given list, and return the last tree before the given point; with path to the root. (Root is at the start of the path)

getAllSubTrees :: IsTree tree => tree t -> [tree t] #

Return all subtrees in a tree, in preorder.

tokenBasedAnnots :: Foldable t1 => (a1 -> Maybe a) -> t1 a1 -> t -> [a] #

tokenBasedStrokes :: Foldable t3 => (a -> b) -> t3 a -> t -> t2 -> t1 -> [b] #

subtreeRegion :: Foldable t => t (Tok t1) -> Region #

fromLeafToLeafAfter :: IsTree tree => Point -> Node (tree (Tok a)) -> Node (tree (Tok a)) #

Search the tree in pre-order starting at a given node, until finding a leaf which is at or after the given point. An effort is also made to return a leaf as close as possible to p.

TODO: rename to fromLeafToLeafAt

fromNodeToFinal :: IsTree tree => Region -> Node (tree (Tok a)) -> Node (tree (Tok a)) #

Given an approximate path to a leaf at the end of the region, return: (path to leaf at the end of the region,path from focused node to the leaf, small node encompassing the region)