yi-mode-haskell-0.19.1: Yi editor haskell mode

License | GPL-2
Maintainer | yi-devel@googlegroups.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Extensions

- DeriveFunctor
- DeriveFoldable

Yi.Syntax.Paren

Description

Parser for Haskell that only cares about parenthesis and layout.

Synopsis

- indentScanner :: Scanner (AlexState lexState) TT -> Scanner (State Token lexState) TT
- isBrace :: TT -> Bool
- ignoredToken :: TT -> Bool
- isNoise :: Token -> Bool
- type Expr t = [Tree t]
- data Tree t
  - = Paren t (Expr t) t
  - | Block [Tree t]
  - | Atom t
  - | Error t
  - | Expr [Tree t]
- getIndentingSubtree :: Tree TT -> Point -> Int -> Maybe (Tree TT)
- getSubtreeSpan :: Tree TT -> (Point, Int)
- parse :: P TT (Tree TT)
- parse' :: (TT -> Token) -> (Token -> TT) -> P TT [Tree TT]
- getStrokes :: Point -> Point -> Point -> Tree TT -> [Stroke]
- tokenToStroke :: TT -> Stroke
- modStroke :: StyleName -> Stroke -> Stroke
- tokenToAnnot :: TT -> Maybe (Span String)
- errTok :: Parser (Tok t) (Tok Token)

# Documentation

indentScanner :: Scanner (AlexState lexState) TT -> Scanner (State Token lexState) TT Source #

isBrace :: TT -> Bool Source #

ignoredToken :: TT -> Bool Source #

isNoise :: Token -> Bool Source #

type Expr t = [Tree t] Source #

data Tree t Source #

Constructors

Paren t (Expr t) t |
Block [Tree t] |
Atom t |
Error t |
Expr [Tree t] |

#### Instances

Instances details

Functor Tree Source # |
Instance details Defined in Yi.Syntax.Paren Methods fmap :: (a -> b) -> Tree a -> Tree b Source # (<$) :: a -> Tree b -> Tree a Source #
Foldable Tree Source # |

Instance details

Defined in Yi.Syntax.Paren

Methods

fold :: Monoid m => Tree m -> m Source #

foldMap :: Monoid m => (a -> m) -> Tree a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Tree a -> m Source #

foldr :: (a -> b -> b) -> b -> Tree a -> b Source #

foldr' :: (a -> b -> b) -> b -> Tree a -> b Source #

foldl :: (b -> a -> b) -> b -> Tree a -> b Source #

foldl' :: (b -> a -> b) -> b -> Tree a -> b Source #

foldr1 :: (a -> a -> a) -> Tree a -> a Source #

foldl1 :: (a -> a -> a) -> Tree a -> a Source #

toList :: Tree a -> [a] Source #

null :: Tree a -> Bool Source #

length :: Tree a -> Int Source #

elem :: Eq a => a -> Tree a -> Bool Source #

maximum :: Ord a => Tree a -> a Source #

minimum :: Ord a => Tree a -> a Source #

sum :: Num a => Tree a -> a Source #

product :: Num a => Tree a -> a Source #

IsTree Tree Source # |
Instance details Defined in Yi.Syntax.Paren Methods subtrees :: Tree t -> [Tree t] Source # uniplate :: Tree t -> ([Tree t], [Tree t] -> Tree t) Source # emptyNode :: Tree t Source #
Show t => Show (Tree t) Source # |
Instance details Defined in Yi.Syntax.Paren Methods showsPrec :: Int -> Tree t -> ShowS Source # show :: Tree t -> String Source # showList :: [Tree t] -> ShowS Source #

getIndentingSubtree :: Tree TT -> Point -> Int -> Maybe (Tree TT) Source #

Search the given list, and return the 1st tree after the given point on the given line. This is the tree that will be moved if something is inserted at the point. Precondition: point is in the given line.

getSubtreeSpan :: Tree TT -> (Point, Int) Source #

Given a tree, return (first offset, number of lines).

parse :: P TT (Tree TT) Source #

parse' :: (TT -> Token) -> (Token -> TT) -> P TT [Tree TT] Source #

getStrokes :: Point -> Point -> Point -> Tree TT -> [Stroke] Source #

tokenToStroke :: TT -> Stroke Source #

modStroke :: StyleName -> Stroke -> Stroke Source #

tokenToAnnot :: TT -> Maybe (Span String) Source #

errTok :: Parser (Tok t) (Tok Token) Source #

Create a special error token. (e.g. fill in where there is no correct token to parse) Note that the position of the token has to be correct for correct computation of node spans.