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

- MonoLocalBinds
- TypeFamilies
- DeriveFoldable
- TypeSynonymInstances
- FlexibleInstances
- KindSignatures
- ExplicitNamespaces

Yi.Syntax.Haskell

Description

Note if the layout of the first line (not comments) is wrong the parser will only parse what is in the blocks given by Layout.hs

Synopsis

- type PModule = Exp
- type PModuleDecl = Exp
- type PImport = Exp
- data Exp t
  - = PModule {
    - comments :: [t]
    - progMod :: Maybe (PModule t)
    }
  - | ProgMod {
    - modDecl :: PModuleDecl t
    - body :: PModule t
    }
  - | Body {
    - imports :: Exp t
    - content :: Block t
    - extraContent :: Block t
    }
  - | PModuleDecl {
    - moduleKeyword :: PAtom t
    - name :: PAtom t
    - exports :: Exp t
    - whereKeyword :: Exp t
    }
  - | PImport {
    - importKeyword :: PAtom t
    - qual :: Exp t
    - name' :: PAtom t
    - as :: Exp t
    - specification :: Exp t
    }
  - | TS t [Exp t]
  - | PType {
    - typeKeyword :: PAtom t
    - typeCons :: Exp t
    - equal :: PAtom t
    - btype :: Exp t
    }
  - | PData {
    - dataKeyword :: PAtom t
    - dtypeCons :: Exp t
    - dEqual :: Exp t
    - dataRhs :: Exp t
    }
  - | PData' {
    - dEqual :: PAtom t
    - dataCons :: Exp t
    }
  - | PClass {
    - cKeyword :: PAtom t
    - cHead :: Exp t
    - cwhere :: Exp t
    }
  - | Paren (PAtom t) [Exp t] (PAtom t)
  - | Block [Exp t]
  - | PAtom t [t]
  - | Expr [Exp t]
  - | PWhere (PAtom t) (Exp t) (Exp t)
  - | Bin (Exp t) (Exp t)
  - | PError {
    - errorTok :: t
    - marker :: t
    - commentList :: [t]
    }
  - | RHS (PAtom t) (Exp t)
  - | Opt (Maybe (Exp t))
  - | Modid t [t]
  - | Context (Exp t) (Exp t) (PAtom t)
  - | PGuard [PGuard t]
  - | PGuard' (PAtom t) (Exp t) (PAtom t)
  - | TC (Exp t)
  - | DC (Exp t)
  - | PLet (PAtom t) (Exp t) (Exp t)
  - | PIn t [Exp t]
- type Tree = PModule
- parse :: P TT (Tree TT)
- indentScanner :: Scanner (AlexState lexState) TT -> Scanner (State Token lexState) TT

# Documentation

type PModule = Exp Source #

type PModuleDecl = Exp Source #

type PImport = Exp Source #

data Exp t Source #

Exp can be expression or declaration

Constructors

PModule |

Fields

- comments :: [t]
- progMod :: Maybe (PModule t)

ProgMod |

Fields

- modDecl :: PModuleDecl t
- body :: PModule t

  The module declaration part

Body |

Fields

- imports :: Exp t
- content :: Block t
- extraContent :: Block t

  The body of the module

PModuleDecl |

Fields

- moduleKeyword :: PAtom t
- name :: PAtom t
- exports :: Exp t
- whereKeyword :: Exp t

PImport |

Fields

- importKeyword :: PAtom t
- qual :: Exp t
- name' :: PAtom t
- as :: Exp t
- specification :: Exp t

TS t [Exp t] | Type signature
PType | Type declaration

Fields

- typeKeyword :: PAtom t
- typeCons :: Exp t
- equal :: PAtom t
- btype :: Exp t

PData | Data declaration

Fields

- dataKeyword :: PAtom t
- dtypeCons :: Exp t
- dEqual :: Exp t
- dataRhs :: Exp t

PData' |

Fields

- dEqual :: PAtom t
- dataCons :: Exp t

  Data declaration RHS

PClass |

Fields

- cKeyword :: PAtom t
- cHead :: Exp t
- cwhere :: Exp t

  Class declaration

Paren (PAtom t) [Exp t] (PAtom t) | A parenthesized, bracketed or braced
Block [Exp t] | A block of things separated by layout
PAtom t [t] | An atom is a token followed by many comments
Expr [Exp t] |
PWhere (PAtom t) (Exp t) (Exp t) | Where clause
Bin (Exp t) (Exp t) |
PError |

Fields

- errorTok :: t
- marker :: t
- commentList :: [t]

  An wrapper for errors

RHS (PAtom t) (Exp t) | Righthandside of functions with =
Opt (Maybe (Exp t)) | An optional
Modid t [t] | Module identifier
Context (Exp t) (Exp t) (PAtom t) |
PGuard [PGuard t] | Righthandside of functions with | the PAtom in PGuard' does not contain any comments
PGuard' (PAtom t) (Exp t) (PAtom t) |
TC (Exp t) | Type constructor data constructor same as with the TC constructor
DC (Exp t) | Data constructor
PLet (PAtom t) (Exp t) (Exp t) | let expression
PIn t [Exp t] |

#### Instances

Instances details

Foldable Exp Source # |

Instance details

Defined in Yi.Syntax.Haskell

Methods

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

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

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

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

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

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

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

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

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

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

null :: Exp a -> Bool Source #

length :: Exp a -> Int Source #

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

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

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

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

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

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

type Tree = PModule Source #

parse :: P TT (Tree TT) Source #

The parser

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