language-python-0.5.4: Parsing and pretty printing of Python code.

Copyright | (c) 2009 Bernie Pope
License | BSD-style
Maintainer | bjpop@csse.unimelb.edu.au
Stability | experimental
Portability | ghc
Safe Haskell | Safe
Language | Haskell98

Language.Python.Common.AST

Contents

- Annotation projection
- Modules
- Identifiers and dotted names
- Statements, suites, parameters, decorators and assignment operators
- Expressions, operators, arguments and slices
- Imports
- Exceptions
- Comprehensions

Description

Representation of the Python abstract syntax tree (AST). The representation is a superset of versions 2.x and 3.x of Python. In many cases they are identical. The documentation in this module indicates where they are different.

All the data types have a (polymorphic) parameter which allows the AST to be annotated by an arbitrary type (for example source locations). Specialised instances of the types are provided for source spans. For example `Module a` is the type of modules, and `ModuleSpan` is the type of modules annoted with source span information.

Note: there are cases where the AST is more liberal than the formal grammar of the language. Therefore some care must be taken when constructing Python programs using the raw AST.

Synopsis

- class Annotated t where
- newtype Module annot = Module [Statement annot]
- type ModuleSpan = Module SrcSpan
- data Ident annot = Ident {
  - ident_string :: !String
  - ident_annot :: annot
  }
- type IdentSpan = Ident SrcSpan
- type DottedName annot = [Ident annot]
- type DottedNameSpan = DottedName SrcSpan
- data Statement annot
  - = Import {
    - import_items :: [ImportItem annot]
    - stmt_annot :: annot
    }
  - | FromImport {
    - from_module :: ImportRelative annot
    - from_items :: FromItems annot
    - stmt_annot :: annot
    }
  - | While {
    - while_cond :: Expr annot
    - while_body :: Suite annot
    - while_else :: Suite annot
    - stmt_annot :: annot
    }
  - | For {
    - for_targets :: [Expr annot]
    - for_generator :: Expr annot
    - for_body :: Suite annot
    - for_else :: Suite annot
    - stmt_annot :: annot
    }
  - | Fun {
    - fun_name :: Ident annot
    - fun_args :: [Parameter annot]
    - fun_result_annotation :: Maybe (Expr annot)
    - fun_body :: Suite annot
    - stmt_annot :: annot
    }
  - | Class {
    - class_name :: Ident annot
    - class_args :: [Argument annot]
    - class_body :: Suite annot
    - stmt_annot :: annot
    }
  - | Conditional {
    - cond_guards :: [(Expr annot, Suite annot)]
    - cond_else :: Suite annot
    - stmt_annot :: annot
    }
  - | Assign {
    - assign_to :: [Expr annot]
    - assign_expr :: Expr annot
    - stmt_annot :: annot
    }
  - | AugmentedAssign {
    - aug_assign_to :: Expr annot
    - aug_assign_op :: AssignOp annot
    - aug_assign_expr :: Expr annot
    - stmt_annot :: annot
    }
  - | Decorated {
    - decorated_decorators :: [Decorator annot]
    - decorated_def :: Statement annot
    - stmt_annot :: annot
    }
  - | Return {
    - return_expr :: Maybe (Expr annot)
    - stmt_annot :: annot
    }
  - | Try {
    - try_body :: Suite annot
    - try_excepts :: [Handler annot]
    - try_else :: Suite annot
    - try_finally :: Suite annot
    - stmt_annot :: annot
    }
  - | Raise {
    - raise_expr :: RaiseExpr annot
    - stmt_annot :: annot
    }
  - | With {
    - with_context :: [(Expr annot, Maybe (Expr annot))]
    - with_body :: Suite annot
    - stmt_annot :: annot
    }
  - | Pass {
    - stmt_annot :: annot
    }
  - | Break {
    - stmt_annot :: annot
    }
  - | Continue {
    - stmt_annot :: annot
    }
  - | Delete {
    - del_exprs :: [Expr annot]
    - stmt_annot :: annot
    }
  - | StmtExpr {
    - stmt_expr :: Expr annot
    - stmt_annot :: annot
    }
  - | Global {
    - global_vars :: [Ident annot]
    - stmt_annot :: annot
    }
  - | NonLocal {
    - nonLocal_vars :: [Ident annot]
    - stmt_annot :: annot
    }
  - | Assert {
    - assert_exprs :: [Expr annot]
    - stmt_annot :: annot
    }
  - | Print {
    - print_chevron :: Bool
    - print_exprs :: [Expr annot]
    - print_trailing_comma :: Bool
    - stmt_annot :: annot
    }
  - | Exec {
    - exec_expr :: Expr annot
    - exec_globals_locals :: Maybe (Expr annot, Maybe (Expr annot))
    - stmt_annot :: annot
    }
- type StatementSpan = Statement SrcSpan
- type Suite annot = [Statement annot]
- type SuiteSpan = Suite SrcSpan
- data Parameter annot
  - = Param {
    - param_name :: Ident annot
    - param_py_annotation :: Maybe (Expr annot)
    - param_default :: Maybe (Expr annot)
    - param_annot :: annot
    }
  - | VarArgsPos {
    - param_name :: Ident annot
    - param_py_annotation :: Maybe (Expr annot)
    - param_annot :: annot
    }
  - | VarArgsKeyword {
    - param_name :: Ident annot
    - param_py_annotation :: Maybe (Expr annot)
    - param_annot :: annot
    }
  - | EndPositional {
    - param_annot :: annot
    }
  - | UnPackTuple {
    - param_unpack_tuple :: ParamTuple annot
    - param_default :: Maybe (Expr annot)
    - param_annot :: annot
    }
- type ParameterSpan = Parameter SrcSpan
- data ParamTuple annot
  - = ParamTupleName {
    - param_tuple_name :: Ident annot
    - param_tuple_annot :: annot
    }
  - | ParamTuple {
    - param_tuple :: [ParamTuple annot]
    - param_tuple_annot :: annot
    }
- type ParamTupleSpan = ParamTuple SrcSpan
- data Decorator annot = Decorator {
  - decorator_name :: DottedName annot
  - decorator_args :: [Argument annot]
  - decorator_annot :: annot
  }
- type DecoratorSpan = Decorator SrcSpan
- data AssignOp annot
  - = PlusAssign {
    - assignOp_annot :: annot
    }
  - | MinusAssign {
    - assignOp_annot :: annot
    }
  - | MultAssign {
    - assignOp_annot :: annot
    }
  - | DivAssign {
    - assignOp_annot :: annot
    }
  - | ModAssign {
    - assignOp_annot :: annot
    }
  - | PowAssign {
    - assignOp_annot :: annot
    }
  - | BinAndAssign {
    - assignOp_annot :: annot
    }
  - | BinOrAssign {
    - assignOp_annot :: annot
    }
  - | BinXorAssign {
    - assignOp_annot :: annot
    }
  - | LeftShiftAssign {
    - assignOp_annot :: annot
    }
  - | RightShiftAssign {
    - assignOp_annot :: annot
    }
  - | FloorDivAssign {
    - assignOp_annot :: annot
    }
- type AssignOpSpan = AssignOp SrcSpan
- data Expr annot
  - = Var {
    - var_ident :: Ident annot
    - expr_annot :: annot
    }
  - | Int {
    - int_value :: Integer
    - expr_literal :: String
    - expr_annot :: annot
    }
  - | LongInt {
    - int_value :: Integer
    - expr_literal :: String
    - expr_annot :: annot
    }
  - | Float {
    - float_value :: Double
    - expr_literal :: String
    - expr_annot :: annot
    }
  - | Imaginary {
    - imaginary_value :: Double
    - expr_literal :: String
    - expr_annot :: annot
    }
  - | Bool {
    - bool_value :: Bool
    - expr_annot :: annot
    }
  - | None {
    - expr_annot :: annot
    }
  - | Ellipsis {
    - expr_annot :: annot
    }
  - | ByteStrings {
    - byte_string_strings :: [String]
    - expr_annot :: annot
    }
  - | Strings {
    - strings_strings :: [String]
    - expr_annot :: annot
    }
  - | UnicodeStrings {
    - unicodestrings_strings :: [String]
    - expr_annot :: annot
    }
  - | Call {
    - call_fun :: Expr annot
    - call_args :: [Argument annot]
    - expr_annot :: annot
    }
  - | Subscript {
    - subscriptee :: Expr annot
    - subscript_expr :: Expr annot
    - expr_annot :: annot
    }
  - | SlicedExpr {
    - slicee :: Expr annot
    - slices :: [Slice annot]
    - expr_annot :: annot
    }
  - | CondExpr {
    - ce_true_branch :: Expr annot
    - ce_condition :: Expr annot
    - ce_false_branch :: Expr annot
    - expr_annot :: annot
    }
  - | BinaryOp {
    - operator :: Op annot
    - left_op_arg :: Expr annot
    - right_op_arg :: Expr annot
    - expr_annot :: annot
    }
  - | UnaryOp {
    - operator :: Op annot
    - op_arg :: Expr annot
    - expr_annot :: annot
    }
  - | Dot {
    - dot_expr :: Expr annot
    - dot_attribute :: Ident annot
    - expr_annot :: annot
    }
  - | Lambda {
    - lambda_args :: [Parameter annot]
    - lambda_body :: Expr annot
    - expr_annot :: annot
    }
  - | Tuple {
    - tuple_exprs :: [Expr annot]
    - expr_annot :: annot
    }
  - | Yield {
    - yield_arg :: Maybe (YieldArg annot)
    - expr_annot :: annot
    }
  - | Generator {
    - gen_comprehension :: Comprehension annot
    - expr_annot :: annot
    }
  - | ListComp {
    - list_comprehension :: Comprehension annot
    - expr_annot :: annot
    }
  - | List {
    - list_exprs :: [Expr annot]
    - expr_annot :: annot
    }
  - | Dictionary {
    - dict_mappings :: [DictMappingPair annot]
    - expr_annot :: annot
    }
  - | DictComp {
    - dict_comprehension :: Comprehension annot
    - expr_annot :: annot
    }
  - | Set {
    - set_exprs :: [Expr annot]
    - expr_annot :: annot
    }
  - | SetComp {
    - set_comprehension :: Comprehension annot
    - expr_annot :: annot
    }
  - | Starred {
    - starred_expr :: Expr annot
    - expr_annot :: annot
    }
  - | Paren {
    - paren_expr :: Expr annot
    - expr_annot :: annot
    }
  - | StringConversion {
    - backquoted_expr :: Expr annot
    - expr_anot :: annot
    }
- type ExprSpan = Expr SrcSpan
- data Op annot
  - = And {
    - op_annot :: annot
    }
  - | Or {
    - op_annot :: annot
    }
  - | Not {
    - op_annot :: annot
    }
  - | Exponent {
    - op_annot :: annot
    }
  - | LessThan {
    - op_annot :: annot
    }
  - | GreaterThan {
    - op_annot :: annot
    }
  - | Equality {
    - op_annot :: annot
    }
  - | GreaterThanEquals {
    - op_annot :: annot
    }
  - | LessThanEquals {
    - op_annot :: annot
    }
  - | NotEquals {
    - op_annot :: annot
    }
  - | NotEqualsV2 {
    - op_annot :: annot
    }
  - | In {
    - op_annot :: annot
    }
  - | Is {
    - op_annot :: annot
    }
  - | IsNot {
    - op_annot :: annot
    }
  - | NotIn {
    - op_annot :: annot
    }
  - | BinaryOr {
    - op_annot :: annot
    }
  - | Xor {
    - op_annot :: annot
    }
  - | BinaryAnd {
    - op_annot :: annot
    }
  - | ShiftLeft {
    - op_annot :: annot
    }
  - | ShiftRight {
    - op_annot :: annot
    }
  - | Multiply {
    - op_annot :: annot
    }
  - | Plus {
    - op_annot :: annot
    }
  - | Minus {
    - op_annot :: annot
    }
  - | Divide {
    - op_annot :: annot
    }
  - | FloorDivide {
    - op_annot :: annot
    }
  - | Invert {
    - op_annot :: annot
    }
  - | Modulo {
    - op_annot :: annot
    }
- type OpSpan = Op SrcSpan
- data Argument annot
  - = ArgExpr {
    - arg_expr :: Expr annot
    - arg_annot :: annot
    }
  - | ArgVarArgsPos {
    - arg_expr :: Expr annot
    - arg_annot :: annot
    }
  - | ArgVarArgsKeyword {
    - arg_expr :: Expr annot
    - arg_annot :: annot
    }
  - | ArgKeyword {
    - arg_keyword :: Ident annot
    - arg_expr :: Expr annot
    - arg_annot :: annot
    }
- type ArgumentSpan = Argument SrcSpan
- data Slice annot
  - = SliceProper {
    - slice_lower :: Maybe (Expr annot)
    - slice_upper :: Maybe (Expr annot)
    - slice_stride :: Maybe (Maybe (Expr annot))
    - slice_annot :: annot
    }
  - | SliceExpr {
    - slice_expr :: Expr annot
    - slice_annot :: annot
    }
  - | SliceEllipsis {
    - slice_annot :: annot
    }
- type SliceSpan = Slice SrcSpan
- data DictMappingPair annot = DictMappingPair (Expr annot) (Expr annot)
- type DictMappingPairSpan = DictMappingPair SrcSpan
- data YieldArg annot
  - = YieldFrom (Expr annot) annot
  - | YieldExpr (Expr annot)
- type YieldArgSpan = YieldArg SrcSpan
- data ImportItem annot = ImportItem {
  - import_item_name :: DottedName annot
  - import_as_name :: Maybe (Ident annot)
  - import_item_annot :: annot
  }
- type ImportItemSpan = ImportItem SrcSpan
- data FromItem annot = FromItem {
  - from_item_name :: Ident annot
  - from_as_name :: Maybe (Ident annot)
  - from_item_annot :: annot
  }
- type FromItemSpan = FromItem SrcSpan
- data FromItems annot
  - = ImportEverything {
    - from_items_annot :: annot
    }
  - | FromItems {
    - from_items_items :: [FromItem annot]
    - from_items_annot :: annot
    }
- type FromItemsSpan = FromItems SrcSpan
- data ImportRelative annot = ImportRelative {
  - import_relative_dots :: Int
  - import_relative_module :: Maybe (DottedName annot)
  - import_relative_annot :: annot
  }
- type ImportRelativeSpan = ImportRelative SrcSpan
- data Handler annot = Handler {
  - handler_clause :: ExceptClause annot
  - handler_suite :: Suite annot
  - handler_annot :: annot
  }
- type HandlerSpan = Handler SrcSpan
- data ExceptClause annot = ExceptClause {
  - except_clause :: Maybe (Expr annot, Maybe (Expr annot))
  - except_clause_annot :: annot
  }
- type ExceptClauseSpan = ExceptClause SrcSpan
- data RaiseExpr annot
  - = RaiseV3 (Maybe (Expr annot, Maybe (Expr annot)))
  - | RaiseV2 (Maybe (Expr annot, Maybe (Expr annot, Maybe (Expr annot))))
- type RaiseExprSpan = RaiseExpr SrcSpan
- data Comprehension annot = Comprehension {
  - comprehension_expr :: ComprehensionExpr annot
  - comprehension_for :: CompFor annot
  - comprehension_annot :: annot
  }
- type ComprehensionSpan = Comprehension SrcSpan
- data ComprehensionExpr annot
  - = ComprehensionExpr (Expr annot)
  - | ComprehensionDict (DictMappingPair annot)
- type ComprehensionExprSpan = ComprehensionExpr SrcSpan
- data CompFor annot = CompFor {
  - comp_for_exprs :: [Expr annot]
  - comp_in_expr :: Expr annot
  - comp_for_iter :: Maybe (CompIter annot)
  - comp_for_annot :: annot
  }
- type CompForSpan = CompFor SrcSpan
- data CompIf annot = CompIf {
  - comp_if :: Expr annot
  - comp_if_iter :: Maybe (CompIter annot)
  - comp_if_annot :: annot
  }
- type CompIfSpan = CompIf SrcSpan
- data CompIter annot
  - = IterFor {
    - comp_iter_for :: CompFor annot
    - comp_iter_annot :: annot
    }
  - | IterIf {
    - comp_iter_if :: CompIf annot
    - comp_iter_annot :: annot
    }
- type CompIterSpan = CompIter SrcSpan

# Annotation projection

class Annotated t where #

Convenient access to annotations in annotated types.

Minimal complete definition

annot

Methods

annot :: t annot -> annot #

Given an annotated type, project out its annotation value.

Instances

Annotated AssignOp # |
Methods annot :: AssignOp annot -> annot #
Annotated Op # |
Methods annot :: Op annot -> annot #
Annotated Slice # |
Methods annot :: Slice annot -> annot #
Annotated Expr # |
Methods annot :: Expr annot -> annot #
Annotated CompIter # |
Methods annot :: CompIter annot -> annot #
Annotated CompIf # |
Methods annot :: CompIf annot -> annot #
Annotated CompFor # |
Methods annot :: CompFor annot -> annot #
Annotated Comprehension # |
Methods annot :: Comprehension annot -> annot #
Annotated ExceptClause # |
Methods annot :: ExceptClause annot -> annot #
Annotated Handler # |
Methods annot :: Handler annot -> annot #
Annotated Argument # |
Methods annot :: Argument annot -> annot #
Annotated ParamTuple # |
Methods annot :: ParamTuple annot -> annot #
Annotated Parameter # |
Methods annot :: Parameter annot -> annot #
Annotated Decorator # |
Methods annot :: Decorator annot -> annot #
Annotated Statement # |
Methods annot :: Statement annot -> annot #
Annotated ImportRelative # |
Methods annot :: ImportRelative annot -> annot #
Annotated FromItems # |
Methods annot :: FromItems annot -> annot #
Annotated FromItem # |
Methods annot :: FromItem annot -> annot #
Annotated ImportItem # |
Methods annot :: ImportItem annot -> annot #
Annotated Ident # |
Methods annot :: Ident annot -> annot #

# Modules

newtype Module annot #

A module (Python source file).

- Version 2.6 http://www.python.org/doc/2.6/reference/toplevel_components.html
- Version 3.1 http://www.python.org/doc/3.1/reference/toplevel_components.html

Constructors

Module [Statement annot] | A module is just a sequence of top-level statements.

Instances

Functor Module # |
Methods fmap :: (a -> b) -> Module a -> Module b # (<$) :: a -> Module b -> Module a #
Eq annot => Eq (Module annot) # |
Methods (==) :: Module annot -> Module annot -> Bool # (/=) :: Module annot -> Module annot -> Bool #
Data annot => Data (Module annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module annot -> c (Module annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Module annot) # toConstr :: Module annot -> Constr # dataTypeOf :: Module annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Module annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Module annot)) # gmapT :: (forall b. Data b => b -> b) -> Module annot -> Module annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Module annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Module annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module annot -> m (Module annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module annot -> m (Module annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module annot -> m (Module annot) #
Ord annot => Ord (Module annot) # |
Methods compare :: Module annot -> Module annot -> Ordering # (<) :: Module annot -> Module annot -> Bool # (<=) :: Module annot -> Module annot -> Bool # (>) :: Module annot -> Module annot -> Bool # (>=) :: Module annot -> Module annot -> Bool # max :: Module annot -> Module annot -> Module annot # min :: Module annot -> Module annot -> Module annot #
Show annot => Show (Module annot) # |
Methods showsPrec :: Int -> Module annot -> ShowS # show :: Module annot -> String # showList :: [Module annot] -> ShowS #

type ModuleSpan = Module SrcSpan #

# Identifiers and dotted names

data Ident annot #

Identifier.

Constructors

Ident |
Fields ident_string :: !String ident_annot :: annot

Instances

Functor Ident # |
Methods fmap :: (a -> b) -> Ident a -> Ident b # (<$) :: a -> Ident b -> Ident a #
Span IdentSpan # |
Methods getSpan :: IdentSpan -> SrcSpan #
Annotated Ident # |
Methods annot :: Ident annot -> annot #
Eq annot => Eq (Ident annot) # |
Methods (==) :: Ident annot -> Ident annot -> Bool # (/=) :: Ident annot -> Ident annot -> Bool #
Data annot => Data (Ident annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ident annot -> c (Ident annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ident annot) # toConstr :: Ident annot -> Constr # dataTypeOf :: Ident annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Ident annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ident annot)) # gmapT :: (forall b. Data b => b -> b) -> Ident annot -> Ident annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ident annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ident annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Ident annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ident annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ident annot -> m (Ident annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ident annot -> m (Ident annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ident annot -> m (Ident annot) #
Ord annot => Ord (Ident annot) # |
Methods compare :: Ident annot -> Ident annot -> Ordering # (<) :: Ident annot -> Ident annot -> Bool # (<=) :: Ident annot -> Ident annot -> Bool # (>) :: Ident annot -> Ident annot -> Bool # (>=) :: Ident annot -> Ident annot -> Bool # max :: Ident annot -> Ident annot -> Ident annot # min :: Ident annot -> Ident annot -> Ident annot #
Show annot => Show (Ident annot) # |
Methods showsPrec :: Int -> Ident annot -> ShowS # show :: Ident annot -> String # showList :: [Ident annot] -> ShowS #

type IdentSpan = Ident SrcSpan #

type DottedName annot = [Ident annot] #

A compound name constructed with the dot operator.

type DottedNameSpan = DottedName SrcSpan #

# Statements, suites, parameters, decorators and assignment operators

data Statement annot #

Statements.

- Simple statements:
- Version 2.6 http://www.python.org/doc/2.6/reference/simple_stmts.html
- Version 3.1 http://www.python.org/doc/3.1/reference/simple_stmts.html
- Compound statements:
- Version 2.6 http://www.python.org/doc/2.6/reference/compound_stmts.html
- Version 3.1 http://www.python.org/doc/3.1/reference/compound_stmts.html

Constructors

Import | Import statement.
Fields import_items :: [ImportItem annot] Items to import. stmt_annot :: annot
FromImport | From ... import statement.
Fields from_module :: ImportRelative annot Module to import from. from_items :: FromItems annot Items to import. stmt_annot :: annot
While | While loop.
Fields while_cond :: Expr annot Loop condition. while_body :: Suite annot Loop body. while_else :: Suite annot Else clause. stmt_annot :: annot
For | For loop.
Fields for_targets :: [Expr annot] Loop variables. for_generator :: Expr annot Loop generator. for_body :: Suite annot Loop body for_else :: Suite annot Else clause. stmt_annot :: annot
Fun | Function definition.
Fields fun_name :: Ident annot Function name. fun_args :: [Parameter annot] Function parameter list. fun_result_annotation :: Maybe (Expr annot) Optional result annotation. fun_body :: Suite annot Function body. stmt_annot :: annot
Class | Class definition.
Fields class_name :: Ident annot Class name. class_args :: [Argument annot] Class argument list. In version 2.x this is only ArgExprs. class_body :: Suite annot Class body. stmt_annot :: annot
Conditional | Conditional statement (if-elif-else).
Fields cond_guards :: [(Expr annot, Suite annot)] Sequence of if-elif conditional clauses. cond_else :: Suite annot Possibly empty unconditional else clause. stmt_annot :: annot
Assign | Assignment statement.
Fields assign_to :: [Expr annot] Entity to assign to. assign_expr :: Expr annot Expression to evaluate. stmt_annot :: annot
AugmentedAssign | Augmented assignment statement.
Fields aug_assign_to :: Expr annot Entity to assign to. aug_assign_op :: AssignOp annot Assignment operator (for example '+='). aug_assign_expr :: Expr annot Expression to evaluate. stmt_annot :: annot
Decorated | Decorated definition of a function or class.
Fields decorated_decorators :: [Decorator annot] Decorators. decorated_def :: Statement annot Function or class definition to be decorated. stmt_annot :: annot
Return | Return statement (may only occur syntactically nested in a function definition).
Fields return_expr :: Maybe (Expr annot) Optional expression to evaluate and return to caller. stmt_annot :: annot
Try | Try statement (exception handling).
Fields try_body :: Suite annot Try clause. try_excepts :: [Handler annot] Exception handlers. try_else :: Suite annot Possibly empty else clause, executed if and when control flows off the end of the try clause. try_finally :: Suite annot Possibly empty finally clause. stmt_annot :: annot
Raise | Raise statement (exception throwing).
Fields raise_expr :: RaiseExpr annot stmt_annot :: annot
With | With statement (context management).
Fields with_context :: [(Expr annot, Maybe (Expr annot))] Context expression(s) (yields a context manager). with_body :: Suite annot Suite to be managed. stmt_annot :: annot
Pass | Pass statement (null operation).
Fields stmt_annot :: annot
Break | Break statement (may only occur syntactically nested in a for or while loop, but not nested in a function or class definition within that loop).
Fields stmt_annot :: annot
Continue | Continue statement (may only occur syntactically nested in a for or while loop, but not nested in a function or class definition or finally clause within that loop).
Fields stmt_annot :: annot
Delete | Del statement (delete).
Fields del_exprs :: [Expr annot] Items to delete. stmt_annot :: annot
StmtExpr | Expression statement.
Fields stmt_expr :: Expr annot stmt_annot :: annot
Global | Global declaration.
Fields global_vars :: [Ident annot] Variables declared global in the current block. stmt_annot :: annot
NonLocal | Nonlocal declaration. Version 3.x only.
Fields nonLocal_vars :: [Ident annot] Variables declared nonlocal in the current block (their binding comes from bound the nearest enclosing scope). stmt_annot :: annot
Assert | Assertion.
Fields assert_exprs :: [Expr annot] Expressions being asserted. stmt_annot :: annot
Print | Print statement. Version 2 only.
Fields print_chevron :: Bool Optional chevron (>>) print_exprs :: [Expr annot] Arguments to print print_trailing_comma :: Bool Does it end in a comma? stmt_annot :: annot
Exec | Exec statement. Version 2 only.
Fields exec_expr :: Expr annot Expression to exec. exec_globals_locals :: Maybe (Expr annot, Maybe (Expr annot)) Global and local environments to evaluate the expression within. stmt_annot :: annot

Instances

Functor Statement # |
Methods fmap :: (a -> b) -> Statement a -> Statement b # (<$) :: a -> Statement b -> Statement a #
Span StatementSpan # |
Methods getSpan :: StatementSpan -> SrcSpan #
Annotated Statement # |
Methods annot :: Statement annot -> annot #
Eq annot => Eq (Statement annot) # |
Methods (==) :: Statement annot -> Statement annot -> Bool # (/=) :: Statement annot -> Statement annot -> Bool #
Data annot => Data (Statement annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Statement annot -> c (Statement annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Statement annot) # toConstr :: Statement annot -> Constr # dataTypeOf :: Statement annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Statement annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Statement annot)) # gmapT :: (forall b. Data b => b -> b) -> Statement annot -> Statement annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Statement annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Statement annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Statement annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Statement annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Statement annot -> m (Statement annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement annot -> m (Statement annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement annot -> m (Statement annot) #
Ord annot => Ord (Statement annot) # |
Methods compare :: Statement annot -> Statement annot -> Ordering # (<) :: Statement annot -> Statement annot -> Bool # (<=) :: Statement annot -> Statement annot -> Bool # (>) :: Statement annot -> Statement annot -> Bool # (>=) :: Statement annot -> Statement annot -> Bool # max :: Statement annot -> Statement annot -> Statement annot # min :: Statement annot -> Statement annot -> Statement annot #
Show annot => Show (Statement annot) # |
Methods showsPrec :: Int -> Statement annot -> ShowS # show :: Statement annot -> String # showList :: [Statement annot] -> ShowS #

type StatementSpan = Statement SrcSpan #

type Suite annot = [Statement annot] #

A block of statements. A suite is a group of statements controlled by a clause, for example, the body of a loop.

- Version 2.6 http://www.python.org/doc/2.6/reference/compound_stmts.html
- Version 3.1 http://www.python.org/doc/3.1/reference/compound_stmts.html

type SuiteSpan = Suite SrcSpan #

data Parameter annot #

Formal parameter of function definitions and lambda expressions.

- Version 2.6:
- http://www.python.org/doc/2.6/reference/compound_stmts.html#function-definitions
- http://www.python.org/doc/2.6/reference/expressions.html#calls
- Version 3.1:
- http://www.python.org/doc/3.1/reference/compound_stmts.html#function-definitions
- http://www.python.org/doc/3.1/reference/expressions.html#calls

Constructors

Param | Ordinary named parameter.
Fields param_name :: Ident annot Parameter name. param_py_annotation :: Maybe (Expr annot) Optional annotation. param_default :: Maybe (Expr annot) Optional default value. param_annot :: annot
VarArgsPos | Excess positional parameter (single asterisk before its name in the concrete syntax).
Fields param_name :: Ident annot Parameter name. param_py_annotation :: Maybe (Expr annot) Optional annotation. param_annot :: annot
VarArgsKeyword | Excess keyword parameter (double asterisk before its name in the concrete syntax).
Fields param_name :: Ident annot Parameter name. param_py_annotation :: Maybe (Expr annot) Optional annotation. param_annot :: annot
EndPositional | Marker for the end of positional parameters (not a parameter itself).
Fields param_annot :: annot
UnPackTuple | Tuple unpack. Version 2 only.
Fields param_unpack_tuple :: ParamTuple annot The tuple to unpack. param_default :: Maybe (Expr annot) Optional default value. param_annot :: annot

Instances

Functor Parameter # |
Methods fmap :: (a -> b) -> Parameter a -> Parameter b # (<$) :: a -> Parameter b -> Parameter a #
Span ParameterSpan # |
Methods getSpan :: ParameterSpan -> SrcSpan #
Annotated Parameter # |
Methods annot :: Parameter annot -> annot #
Eq annot => Eq (Parameter annot) # |
Methods (==) :: Parameter annot -> Parameter annot -> Bool # (/=) :: Parameter annot -> Parameter annot -> Bool #
Data annot => Data (Parameter annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Parameter annot -> c (Parameter annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Parameter annot) # toConstr :: Parameter annot -> Constr # dataTypeOf :: Parameter annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Parameter annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Parameter annot)) # gmapT :: (forall b. Data b => b -> b) -> Parameter annot -> Parameter annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Parameter annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Parameter annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Parameter annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Parameter annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Parameter annot -> m (Parameter annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Parameter annot -> m (Parameter annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Parameter annot -> m (Parameter annot) #
Ord annot => Ord (Parameter annot) # |
Methods compare :: Parameter annot -> Parameter annot -> Ordering # (<) :: Parameter annot -> Parameter annot -> Bool # (<=) :: Parameter annot -> Parameter annot -> Bool # (>) :: Parameter annot -> Parameter annot -> Bool # (>=) :: Parameter annot -> Parameter annot -> Bool # max :: Parameter annot -> Parameter annot -> Parameter annot # min :: Parameter annot -> Parameter annot -> Parameter annot #
Show annot => Show (Parameter annot) # |
Methods showsPrec :: Int -> Parameter annot -> ShowS # show :: Parameter annot -> String # showList :: [Parameter annot] -> ShowS #

type ParameterSpan = Parameter SrcSpan #

data ParamTuple annot #

Tuple unpack parameter. Version 2 only.

Constructors

ParamTupleName | A variable name.
Fields param_tuple_name :: Ident annot param_tuple_annot :: annot
ParamTuple | A (possibly nested) tuple parameter.
Fields param_tuple :: [ParamTuple annot] param_tuple_annot :: annot

Instances

Functor ParamTuple # |
Methods fmap :: (a -> b) -> ParamTuple a -> ParamTuple b # (<$) :: a -> ParamTuple b -> ParamTuple a #
Span ParamTupleSpan # |
Methods getSpan :: ParamTupleSpan -> SrcSpan #
Annotated ParamTuple # |
Methods annot :: ParamTuple annot -> annot #
Eq annot => Eq (ParamTuple annot) # |
Methods (==) :: ParamTuple annot -> ParamTuple annot -> Bool # (/=) :: ParamTuple annot -> ParamTuple annot -> Bool #
Data annot => Data (ParamTuple annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ParamTuple annot -> c (ParamTuple annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ParamTuple annot) # toConstr :: ParamTuple annot -> Constr # dataTypeOf :: ParamTuple annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ParamTuple annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ParamTuple annot)) # gmapT :: (forall b. Data b => b -> b) -> ParamTuple annot -> ParamTuple annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ParamTuple annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ParamTuple annot -> r # gmapQ :: (forall d. Data d => d -> u) -> ParamTuple annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ParamTuple annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ParamTuple annot -> m (ParamTuple annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamTuple annot -> m (ParamTuple annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ParamTuple annot -> m (ParamTuple annot) #
Ord annot => Ord (ParamTuple annot) # |
Methods compare :: ParamTuple annot -> ParamTuple annot -> Ordering # (<) :: ParamTuple annot -> ParamTuple annot -> Bool # (<=) :: ParamTuple annot -> ParamTuple annot -> Bool # (>) :: ParamTuple annot -> ParamTuple annot -> Bool # (>=) :: ParamTuple annot -> ParamTuple annot -> Bool # max :: ParamTuple annot -> ParamTuple annot -> ParamTuple annot # min :: ParamTuple annot -> ParamTuple annot -> ParamTuple annot #
Show annot => Show (ParamTuple annot) # |
Methods showsPrec :: Int -> ParamTuple annot -> ShowS # show :: ParamTuple annot -> String # showList :: [ParamTuple annot] -> ShowS #

type ParamTupleSpan = ParamTuple SrcSpan #

data Decorator annot #

Decorator.

Constructors

Decorator |
Fields decorator_name :: DottedName annot Decorator name. decorator_args :: [Argument annot] Decorator arguments. decorator_annot :: annot

Instances

Functor Decorator # |
Methods fmap :: (a -> b) -> Decorator a -> Decorator b # (<$) :: a -> Decorator b -> Decorator a #
Span DecoratorSpan # |
Methods getSpan :: DecoratorSpan -> SrcSpan #
Annotated Decorator # |
Methods annot :: Decorator annot -> annot #
Eq annot => Eq (Decorator annot) # |
Methods (==) :: Decorator annot -> Decorator annot -> Bool # (/=) :: Decorator annot -> Decorator annot -> Bool #
Data annot => Data (Decorator annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Decorator annot -> c (Decorator annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Decorator annot) # toConstr :: Decorator annot -> Constr # dataTypeOf :: Decorator annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Decorator annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Decorator annot)) # gmapT :: (forall b. Data b => b -> b) -> Decorator annot -> Decorator annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Decorator annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Decorator annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Decorator annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Decorator annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Decorator annot -> m (Decorator annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Decorator annot -> m (Decorator annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Decorator annot -> m (Decorator annot) #
Ord annot => Ord (Decorator annot) # |
Methods compare :: Decorator annot -> Decorator annot -> Ordering # (<) :: Decorator annot -> Decorator annot -> Bool # (<=) :: Decorator annot -> Decorator annot -> Bool # (>) :: Decorator annot -> Decorator annot -> Bool # (>=) :: Decorator annot -> Decorator annot -> Bool # max :: Decorator annot -> Decorator annot -> Decorator annot # min :: Decorator annot -> Decorator annot -> Decorator annot #
Show annot => Show (Decorator annot) # |
Methods showsPrec :: Int -> Decorator annot -> ShowS # show :: Decorator annot -> String # showList :: [Decorator annot] -> ShowS #

type DecoratorSpan = Decorator SrcSpan #

data AssignOp annot #

Augmented assignment operators.

Constructors

PlusAssign | '+='
Fields assignOp_annot :: annot
MinusAssign | '-='
Fields assignOp_annot :: annot
MultAssign | '*='
Fields assignOp_annot :: annot
DivAssign | '/='
Fields assignOp_annot :: annot
ModAssign | '%='
Fields assignOp_annot :: annot
PowAssign | '*='
Fields assignOp_annot :: annot
BinAndAssign | '&='
Fields assignOp_annot :: annot
BinOrAssign | '|='
Fields assignOp_annot :: annot
BinXorAssign | '^='
Fields assignOp_annot :: annot
LeftShiftAssign | '<<='
Fields assignOp_annot :: annot
RightShiftAssign | '>>='
Fields assignOp_annot :: annot
FloorDivAssign | '//='
Fields assignOp_annot :: annot

Instances

Functor AssignOp # |
Methods fmap :: (a -> b) -> AssignOp a -> AssignOp b # (<$) :: a -> AssignOp b -> AssignOp a #
Span AssignOpSpan # |
Methods getSpan :: AssignOpSpan -> SrcSpan #
Annotated AssignOp # |
Methods annot :: AssignOp annot -> annot #
Eq annot => Eq (AssignOp annot) # |
Methods (==) :: AssignOp annot -> AssignOp annot -> Bool # (/=) :: AssignOp annot -> AssignOp annot -> Bool #
Data annot => Data (AssignOp annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AssignOp annot -> c (AssignOp annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (AssignOp annot) # toConstr :: AssignOp annot -> Constr # dataTypeOf :: AssignOp annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (AssignOp annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (AssignOp annot)) # gmapT :: (forall b. Data b => b -> b) -> AssignOp annot -> AssignOp annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AssignOp annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AssignOp annot -> r # gmapQ :: (forall d. Data d => d -> u) -> AssignOp annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AssignOp annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AssignOp annot -> m (AssignOp annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AssignOp annot -> m (AssignOp annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AssignOp annot -> m (AssignOp annot) #
Ord annot => Ord (AssignOp annot) # |
Methods compare :: AssignOp annot -> AssignOp annot -> Ordering # (<) :: AssignOp annot -> AssignOp annot -> Bool # (<=) :: AssignOp annot -> AssignOp annot -> Bool # (>) :: AssignOp annot -> AssignOp annot -> Bool # (>=) :: AssignOp annot -> AssignOp annot -> Bool # max :: AssignOp annot -> AssignOp annot -> AssignOp annot # min :: AssignOp annot -> AssignOp annot -> AssignOp annot #
Show annot => Show (AssignOp annot) # |
Methods showsPrec :: Int -> AssignOp annot -> ShowS # show :: AssignOp annot -> String # showList :: [AssignOp annot] -> ShowS #

type AssignOpSpan = AssignOp SrcSpan #

# Expressions, operators, arguments and slices

data Expr annot #

Expressions.

- Version 2.6 http://www.python.org/doc/2.6/reference/expressions.html.
- Version 3.1 http://www.python.org/doc/3.1/reference/expressions.html.

Constructors

Var | Variable.
Fields var_ident :: Ident annot expr_annot :: annot
Int | Literal integer.
Fields int_value :: Integer expr_literal :: String expr_annot :: annot
LongInt | Long literal integer. Version 2 only.
Fields int_value :: Integer expr_literal :: String expr_annot :: annot
Float | Literal floating point number.
Fields float_value :: Double expr_literal :: String expr_annot :: annot
Imaginary | Literal imaginary number.
Fields imaginary_value :: Double expr_literal :: String expr_annot :: annot
Bool | Literal boolean.
Fields bool_value :: Bool expr_annot :: annot
None | Literal 'None' value.
Fields expr_annot :: annot
Ellipsis | Ellipsis '...'.
Fields expr_annot :: annot
ByteStrings | Literal byte string.
Fields byte_string_strings :: [String] expr_annot :: annot
Strings | Literal strings (to be concatentated together).
Fields strings_strings :: [String] expr_annot :: annot
UnicodeStrings | Unicode literal strings (to be concatentated together). Version 2 only.
Fields unicodestrings_strings :: [String] expr_annot :: annot
Call | Function call.
Fields call_fun :: Expr annot Expression yielding a callable object (such as a function). call_args :: [Argument annot] Call arguments. expr_annot :: annot
Subscript | Subscription, for example 'x [y]'.
Fields subscriptee :: Expr annot subscript_expr :: Expr annot expr_annot :: annot
SlicedExpr | Slicing, for example 'w [x:y:z]'.
Fields slicee :: Expr annot slices :: [Slice annot] expr_annot :: annot
CondExpr | Conditional expresison.
Fields ce_true_branch :: Expr annot Expression to evaluate if condition is True. ce_condition :: Expr annot Boolean condition. ce_false_branch :: Expr annot Expression to evaluate if condition is False. expr_annot :: annot
BinaryOp | Binary operator application.
Fields operator :: Op annot left_op_arg :: Expr annot right_op_arg :: Expr annot expr_annot :: annot
UnaryOp | Unary operator application.
Fields operator :: Op annot op_arg :: Expr annot expr_annot :: annot
Dot |
Fields dot_expr :: Expr annot dot_attribute :: Ident annot expr_annot :: annot
Lambda | Anonymous function definition (lambda).
Fields lambda_args :: [Parameter annot] lambda_body :: Expr annot expr_annot :: annot
Tuple | Tuple. Can be empty.
Fields tuple_exprs :: [Expr annot] expr_annot :: annot
Yield | Generator yield.
Fields yield_arg :: Maybe (YieldArg annot) Optional Yield argument. expr_annot :: annot
Generator | Generator.
Fields gen_comprehension :: Comprehension annot expr_annot :: annot
ListComp | List comprehension.
Fields list_comprehension :: Comprehension annot expr_annot :: annot
List | List.
Fields list_exprs :: [Expr annot] expr_annot :: annot
Dictionary | Dictionary.
Fields dict_mappings :: [DictMappingPair annot] expr_annot :: annot
DictComp | Dictionary comprehension. Version 3 only.
Fields dict_comprehension :: Comprehension annot expr_annot :: annot
Set | Set.
Fields set_exprs :: [Expr annot] expr_annot :: annot
SetComp | Set comprehension. Version 3 only.
Fields set_comprehension :: Comprehension annot expr_annot :: annot
Starred | Starred expression. Version 3 only.
Fields starred_expr :: Expr annot expr_annot :: annot
Paren | Parenthesised expression.
Fields paren_expr :: Expr annot expr_annot :: annot
StringConversion | String conversion (backquoted expression). Version 2 only.
Fields backquoted_expr :: Expr annot expr_anot :: annot

Instances

Functor Expr # |
Methods fmap :: (a -> b) -> Expr a -> Expr b # (<$) :: a -> Expr b -> Expr a #
Span ExprSpan # |
Methods getSpan :: ExprSpan -> SrcSpan #
Annotated Expr # |
Methods annot :: Expr annot -> annot #
Eq annot => Eq (Expr annot) # |
Methods (==) :: Expr annot -> Expr annot -> Bool # (/=) :: Expr annot -> Expr annot -> Bool #
Data annot => Data (Expr annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Expr annot -> c (Expr annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expr annot) # toConstr :: Expr annot -> Constr # dataTypeOf :: Expr annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Expr annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr annot)) # gmapT :: (forall b. Data b => b -> b) -> Expr annot -> Expr annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Expr annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expr annot -> m (Expr annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr annot -> m (Expr annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr annot -> m (Expr annot) #
Ord annot => Ord (Expr annot) # |
Methods compare :: Expr annot -> Expr annot -> Ordering # (<) :: Expr annot -> Expr annot -> Bool # (<=) :: Expr annot -> Expr annot -> Bool # (>) :: Expr annot -> Expr annot -> Bool # (>=) :: Expr annot -> Expr annot -> Bool # max :: Expr annot -> Expr annot -> Expr annot # min :: Expr annot -> Expr annot -> Expr annot #
Show annot => Show (Expr annot) # |
Methods showsPrec :: Int -> Expr annot -> ShowS # show :: Expr annot -> String # showList :: [Expr annot] -> ShowS #

type ExprSpan = Expr SrcSpan #

data Op annot #

Operators.

Constructors

And | 'and'
Fields op_annot :: annot
Or | 'or'
Fields op_annot :: annot
Not | 'not'
Fields op_annot :: annot
Exponent | '**'
Fields op_annot :: annot
LessThan | '<'
Fields op_annot :: annot
GreaterThan | '>'
Fields op_annot :: annot
Equality | '=='
Fields op_annot :: annot
GreaterThanEquals | '>='
Fields op_annot :: annot
LessThanEquals | '<='
Fields op_annot :: annot
NotEquals | '!='
Fields op_annot :: annot
NotEqualsV2 | '<>'. Version 2 only.
Fields op_annot :: annot
In | 'in'
Fields op_annot :: annot
Is | 'is'
Fields op_annot :: annot
IsNot | 'is not'
Fields op_annot :: annot
NotIn | 'not in'
Fields op_annot :: annot
BinaryOr | '|'
Fields op_annot :: annot
Xor | '^'
Fields op_annot :: annot
BinaryAnd | '&'
Fields op_annot :: annot
ShiftLeft | '<<'
Fields op_annot :: annot
ShiftRight | '>>'
Fields op_annot :: annot
Multiply | '*'
Fields op_annot :: annot
Plus | '+'
Fields op_annot :: annot
Minus | '-'
Fields op_annot :: annot
Divide | '/'
Fields op_annot :: annot
FloorDivide | '//'
Fields op_annot :: annot
Invert | '~' (bitwise inversion of its integer argument)
Fields op_annot :: annot
Modulo | '%'
Fields op_annot :: annot

Instances

Functor Op # |
Methods fmap :: (a -> b) -> Op a -> Op b # (<$) :: a -> Op b -> Op a #
Span OpSpan # |
Methods getSpan :: OpSpan -> SrcSpan #
Annotated Op # |
Methods annot :: Op annot -> annot #
Eq annot => Eq (Op annot) # |
Methods (==) :: Op annot -> Op annot -> Bool # (/=) :: Op annot -> Op annot -> Bool #
Data annot => Data (Op annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Op annot -> c (Op annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Op annot) # toConstr :: Op annot -> Constr # dataTypeOf :: Op annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Op annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Op annot)) # gmapT :: (forall b. Data b => b -> b) -> Op annot -> Op annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Op annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Op annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Op annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Op annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Op annot -> m (Op annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Op annot -> m (Op annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Op annot -> m (Op annot) #
Ord annot => Ord (Op annot) # |
Methods compare :: Op annot -> Op annot -> Ordering # (<) :: Op annot -> Op annot -> Bool # (<=) :: Op annot -> Op annot -> Bool # (>) :: Op annot -> Op annot -> Bool # (>=) :: Op annot -> Op annot -> Bool # max :: Op annot -> Op annot -> Op annot # min :: Op annot -> Op annot -> Op annot #
Show annot => Show (Op annot) # |
Methods showsPrec :: Int -> Op annot -> ShowS # show :: Op annot -> String # showList :: [Op annot] -> ShowS #

type OpSpan = Op SrcSpan #

data Argument annot #

Arguments to function calls, class declarations and decorators.

Constructors

ArgExpr | Ordinary argument expression.
Fields arg_expr :: Expr annot Argument expression. arg_annot :: annot
ArgVarArgsPos | Excess positional argument.
Fields arg_expr :: Expr annot Argument expression. arg_annot :: annot
ArgVarArgsKeyword | Excess keyword argument.
Fields arg_expr :: Expr annot Argument expression. arg_annot :: annot
ArgKeyword | Keyword argument.
Fields arg_keyword :: Ident annot Keyword name. arg_expr :: Expr annot Argument expression. arg_annot :: annot

Instances

Functor Argument # |
Methods fmap :: (a -> b) -> Argument a -> Argument b # (<$) :: a -> Argument b -> Argument a #
Span ArgumentSpan # |
Methods getSpan :: ArgumentSpan -> SrcSpan #
Annotated Argument # |
Methods annot :: Argument annot -> annot #
Eq annot => Eq (Argument annot) # |
Methods (==) :: Argument annot -> Argument annot -> Bool # (/=) :: Argument annot -> Argument annot -> Bool #
Data annot => Data (Argument annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Argument annot -> c (Argument annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Argument annot) # toConstr :: Argument annot -> Constr # dataTypeOf :: Argument annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Argument annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Argument annot)) # gmapT :: (forall b. Data b => b -> b) -> Argument annot -> Argument annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Argument annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Argument annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Argument annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Argument annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Argument annot -> m (Argument annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Argument annot -> m (Argument annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Argument annot -> m (Argument annot) #
Ord annot => Ord (Argument annot) # |
Methods compare :: Argument annot -> Argument annot -> Ordering # (<) :: Argument annot -> Argument annot -> Bool # (<=) :: Argument annot -> Argument annot -> Bool # (>) :: Argument annot -> Argument annot -> Bool # (>=) :: Argument annot -> Argument annot -> Bool # max :: Argument annot -> Argument annot -> Argument annot # min :: Argument annot -> Argument annot -> Argument annot #
Show annot => Show (Argument annot) # |
Methods showsPrec :: Int -> Argument annot -> ShowS # show :: Argument annot -> String # showList :: [Argument annot] -> ShowS #

type ArgumentSpan = Argument SrcSpan #

data Slice annot #

Slice compenent.

Constructors

SliceProper |
Fields slice_lower :: Maybe (Expr annot) slice_upper :: Maybe (Expr annot) slice_stride :: Maybe (Maybe (Expr annot)) slice_annot :: annot
SliceExpr |
Fields slice_expr :: Expr annot slice_annot :: annot
SliceEllipsis |
Fields slice_annot :: annot

Instances

Functor Slice # |
Methods fmap :: (a -> b) -> Slice a -> Slice b # (<$) :: a -> Slice b -> Slice a #
Span SliceSpan # |
Methods getSpan :: SliceSpan -> SrcSpan #
Annotated Slice # |
Methods annot :: Slice annot -> annot #
Eq annot => Eq (Slice annot) # |
Methods (==) :: Slice annot -> Slice annot -> Bool # (/=) :: Slice annot -> Slice annot -> Bool #
Data annot => Data (Slice annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Slice annot -> c (Slice annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Slice annot) # toConstr :: Slice annot -> Constr # dataTypeOf :: Slice annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Slice annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Slice annot)) # gmapT :: (forall b. Data b => b -> b) -> Slice annot -> Slice annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Slice annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Slice annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Slice annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Slice annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Slice annot -> m (Slice annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Slice annot -> m (Slice annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Slice annot -> m (Slice annot) #
Ord annot => Ord (Slice annot) # |
Methods compare :: Slice annot -> Slice annot -> Ordering # (<) :: Slice annot -> Slice annot -> Bool # (<=) :: Slice annot -> Slice annot -> Bool # (>) :: Slice annot -> Slice annot -> Bool # (>=) :: Slice annot -> Slice annot -> Bool # max :: Slice annot -> Slice annot -> Slice annot # min :: Slice annot -> Slice annot -> Slice annot #
Show annot => Show (Slice annot) # |
Methods showsPrec :: Int -> Slice annot -> ShowS # show :: Slice annot -> String # showList :: [Slice annot] -> ShowS #

type SliceSpan = Slice SrcSpan #

data DictMappingPair annot #

Constructors

DictMappingPair (Expr annot) (Expr annot) |

Instances

Functor DictMappingPair # |
Methods fmap :: (a -> b) -> DictMappingPair a -> DictMappingPair b # (<$) :: a -> DictMappingPair b -> DictMappingPair a #
Span DictMappingPairSpan # |
Methods getSpan :: DictMappingPairSpan -> SrcSpan #
Eq annot => Eq (DictMappingPair annot) # |
Methods (==) :: DictMappingPair annot -> DictMappingPair annot -> Bool # (/=) :: DictMappingPair annot -> DictMappingPair annot -> Bool #
Data annot => Data (DictMappingPair annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DictMappingPair annot -> c (DictMappingPair annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (DictMappingPair annot) # toConstr :: DictMappingPair annot -> Constr # dataTypeOf :: DictMappingPair annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (DictMappingPair annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (DictMappingPair annot)) # gmapT :: (forall b. Data b => b -> b) -> DictMappingPair annot -> DictMappingPair annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DictMappingPair annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DictMappingPair annot -> r # gmapQ :: (forall d. Data d => d -> u) -> DictMappingPair annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DictMappingPair annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DictMappingPair annot -> m (DictMappingPair annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DictMappingPair annot -> m (DictMappingPair annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DictMappingPair annot -> m (DictMappingPair annot) #
Ord annot => Ord (DictMappingPair annot) # |
Methods compare :: DictMappingPair annot -> DictMappingPair annot -> Ordering # (<) :: DictMappingPair annot -> DictMappingPair annot -> Bool # (<=) :: DictMappingPair annot -> DictMappingPair annot -> Bool # (>) :: DictMappingPair annot -> DictMappingPair annot -> Bool # (>=) :: DictMappingPair annot -> DictMappingPair annot -> Bool # max :: DictMappingPair annot -> DictMappingPair annot -> DictMappingPair annot # min :: DictMappingPair annot -> DictMappingPair annot -> DictMappingPair annot #
Show annot => Show (DictMappingPair annot) # |
Methods showsPrec :: Int -> DictMappingPair annot -> ShowS # show :: DictMappingPair annot -> String # showList :: [DictMappingPair annot] -> ShowS #

type DictMappingPairSpan = DictMappingPair SrcSpan #

data YieldArg annot #

Constructors

YieldFrom (Expr annot) annot | Yield from a generator (Version 3 only)
YieldExpr (Expr annot) | Yield value of an expression

Instances

Functor YieldArg # |
Methods fmap :: (a -> b) -> YieldArg a -> YieldArg b # (<$) :: a -> YieldArg b -> YieldArg a #
Span YieldArgSpan # |
Methods getSpan :: YieldArgSpan -> SrcSpan #
Eq annot => Eq (YieldArg annot) # |
Methods (==) :: YieldArg annot -> YieldArg annot -> Bool # (/=) :: YieldArg annot -> YieldArg annot -> Bool #
Data annot => Data (YieldArg annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> YieldArg annot -> c (YieldArg annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (YieldArg annot) # toConstr :: YieldArg annot -> Constr # dataTypeOf :: YieldArg annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (YieldArg annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (YieldArg annot)) # gmapT :: (forall b. Data b => b -> b) -> YieldArg annot -> YieldArg annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> YieldArg annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> YieldArg annot -> r # gmapQ :: (forall d. Data d => d -> u) -> YieldArg annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> YieldArg annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> YieldArg annot -> m (YieldArg annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> YieldArg annot -> m (YieldArg annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> YieldArg annot -> m (YieldArg annot) #
Ord annot => Ord (YieldArg annot) # |
Methods compare :: YieldArg annot -> YieldArg annot -> Ordering # (<) :: YieldArg annot -> YieldArg annot -> Bool # (<=) :: YieldArg annot -> YieldArg annot -> Bool # (>) :: YieldArg annot -> YieldArg annot -> Bool # (>=) :: YieldArg annot -> YieldArg annot -> Bool # max :: YieldArg annot -> YieldArg annot -> YieldArg annot # min :: YieldArg annot -> YieldArg annot -> YieldArg annot #
Show annot => Show (YieldArg annot) # |
Methods showsPrec :: Int -> YieldArg annot -> ShowS # show :: YieldArg annot -> String # showList :: [YieldArg annot] -> ShowS #

type YieldArgSpan = YieldArg SrcSpan #

# Imports

data ImportItem annot #

An entity imported using the 'import' keyword.

- Version 2.6 http://www.python.org/doc/2.6/reference/simple_stmts.html#the-import-statement
- Version 3.1 http://www.python.org/doc/3.1/reference/simple_stmts.html#the-import-statement

Constructors

ImportItem |
Fields import_item_name :: DottedName annot The name of module to import. import_as_name :: Maybe (Ident annot) An optional name to refer to the entity (the 'as' name). import_item_annot :: annot

Instances

Functor ImportItem # |
Methods fmap :: (a -> b) -> ImportItem a -> ImportItem b # (<$) :: a -> ImportItem b -> ImportItem a #
Span ImportItemSpan # |
Methods getSpan :: ImportItemSpan -> SrcSpan #
Annotated ImportItem # |
Methods annot :: ImportItem annot -> annot #
Eq annot => Eq (ImportItem annot) # |
Methods (==) :: ImportItem annot -> ImportItem annot -> Bool # (/=) :: ImportItem annot -> ImportItem annot -> Bool #
Data annot => Data (ImportItem annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImportItem annot -> c (ImportItem annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ImportItem annot) # toConstr :: ImportItem annot -> Constr # dataTypeOf :: ImportItem annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ImportItem annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ImportItem annot)) # gmapT :: (forall b. Data b => b -> b) -> ImportItem annot -> ImportItem annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImportItem annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImportItem annot -> r # gmapQ :: (forall d. Data d => d -> u) -> ImportItem annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ImportItem annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImportItem annot -> m (ImportItem annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportItem annot -> m (ImportItem annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportItem annot -> m (ImportItem annot) #
Ord annot => Ord (ImportItem annot) # |
Methods compare :: ImportItem annot -> ImportItem annot -> Ordering # (<) :: ImportItem annot -> ImportItem annot -> Bool # (<=) :: ImportItem annot -> ImportItem annot -> Bool # (>) :: ImportItem annot -> ImportItem annot -> Bool # (>=) :: ImportItem annot -> ImportItem annot -> Bool # max :: ImportItem annot -> ImportItem annot -> ImportItem annot # min :: ImportItem annot -> ImportItem annot -> ImportItem annot #
Show annot => Show (ImportItem annot) # |
Methods showsPrec :: Int -> ImportItem annot -> ShowS # show :: ImportItem annot -> String # showList :: [ImportItem annot] -> ShowS #

type ImportItemSpan = ImportItem SrcSpan #

data FromItem annot #

An entity imported using the 'from ... import' construct.

- Version 2.6 http://www.python.org/doc/2.6/reference/simple_stmts.html#the-import-statement
- Version 3.1 http://www.python.org/doc/3.1/reference/simple_stmts.html#the-import-statement

Constructors

FromItem |
Fields from_item_name :: Ident annot The name of the entity imported. from_as_name :: Maybe (Ident annot) An optional name to refer to the entity (the 'as' name). from_item_annot :: annot

Instances

Functor FromItem # |
Methods fmap :: (a -> b) -> FromItem a -> FromItem b # (<$) :: a -> FromItem b -> FromItem a #
Span FromItemSpan # |
Methods getSpan :: FromItemSpan -> SrcSpan #
Annotated FromItem # |
Methods annot :: FromItem annot -> annot #
Eq annot => Eq (FromItem annot) # |
Methods (==) :: FromItem annot -> FromItem annot -> Bool # (/=) :: FromItem annot -> FromItem annot -> Bool #
Data annot => Data (FromItem annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FromItem annot -> c (FromItem annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (FromItem annot) # toConstr :: FromItem annot -> Constr # dataTypeOf :: FromItem annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (FromItem annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (FromItem annot)) # gmapT :: (forall b. Data b => b -> b) -> FromItem annot -> FromItem annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FromItem annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FromItem annot -> r # gmapQ :: (forall d. Data d => d -> u) -> FromItem annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FromItem annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FromItem annot -> m (FromItem annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FromItem annot -> m (FromItem annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FromItem annot -> m (FromItem annot) #
Ord annot => Ord (FromItem annot) # |
Methods compare :: FromItem annot -> FromItem annot -> Ordering # (<) :: FromItem annot -> FromItem annot -> Bool # (<=) :: FromItem annot -> FromItem annot -> Bool # (>) :: FromItem annot -> FromItem annot -> Bool # (>=) :: FromItem annot -> FromItem annot -> Bool # max :: FromItem annot -> FromItem annot -> FromItem annot # min :: FromItem annot -> FromItem annot -> FromItem annot #
Show annot => Show (FromItem annot) # |
Methods showsPrec :: Int -> FromItem annot -> ShowS # show :: FromItem annot -> String # showList :: [FromItem annot] -> ShowS #

type FromItemSpan = FromItem SrcSpan #

data FromItems annot #

Items imported using the 'from ... import' construct.

Constructors

ImportEverything | Import everything exported from the module.
Fields from_items_annot :: annot
FromItems | Import a specific list of items from the module.
Fields from_items_items :: [FromItem annot] from_items_annot :: annot

Instances

Functor FromItems # |
Methods fmap :: (a -> b) -> FromItems a -> FromItems b # (<$) :: a -> FromItems b -> FromItems a #
Span FromItemsSpan # |
Methods getSpan :: FromItemsSpan -> SrcSpan #
Annotated FromItems # |
Methods annot :: FromItems annot -> annot #
Eq annot => Eq (FromItems annot) # |
Methods (==) :: FromItems annot -> FromItems annot -> Bool # (/=) :: FromItems annot -> FromItems annot -> Bool #
Data annot => Data (FromItems annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FromItems annot -> c (FromItems annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (FromItems annot) # toConstr :: FromItems annot -> Constr # dataTypeOf :: FromItems annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (FromItems annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (FromItems annot)) # gmapT :: (forall b. Data b => b -> b) -> FromItems annot -> FromItems annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FromItems annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FromItems annot -> r # gmapQ :: (forall d. Data d => d -> u) -> FromItems annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FromItems annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FromItems annot -> m (FromItems annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FromItems annot -> m (FromItems annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FromItems annot -> m (FromItems annot) #
Ord annot => Ord (FromItems annot) # |
Methods compare :: FromItems annot -> FromItems annot -> Ordering # (<) :: FromItems annot -> FromItems annot -> Bool # (<=) :: FromItems annot -> FromItems annot -> Bool # (>) :: FromItems annot -> FromItems annot -> Bool # (>=) :: FromItems annot -> FromItems annot -> Bool # max :: FromItems annot -> FromItems annot -> FromItems annot # min :: FromItems annot -> FromItems annot -> FromItems annot #
Show annot => Show (FromItems annot) # |
Methods showsPrec :: Int -> FromItems annot -> ShowS # show :: FromItems annot -> String # showList :: [FromItems annot] -> ShowS #

type FromItemsSpan = FromItems SrcSpan #

data ImportRelative annot #

A reference to the module to import from using the 'from ... import' construct.

Constructors

ImportRelative |
Fields import_relative_dots :: Int import_relative_module :: Maybe (DottedName annot) import_relative_annot :: annot

Instances

Functor ImportRelative # |
Methods fmap :: (a -> b) -> ImportRelative a -> ImportRelative b # (<$) :: a -> ImportRelative b -> ImportRelative a #
Span ImportRelativeSpan # |
Methods getSpan :: ImportRelativeSpan -> SrcSpan #
Annotated ImportRelative # |
Methods annot :: ImportRelative annot -> annot #
Eq annot => Eq (ImportRelative annot) # |
Methods (==) :: ImportRelative annot -> ImportRelative annot -> Bool # (/=) :: ImportRelative annot -> ImportRelative annot -> Bool #
Data annot => Data (ImportRelative annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImportRelative annot -> c (ImportRelative annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ImportRelative annot) # toConstr :: ImportRelative annot -> Constr # dataTypeOf :: ImportRelative annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ImportRelative annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ImportRelative annot)) # gmapT :: (forall b. Data b => b -> b) -> ImportRelative annot -> ImportRelative annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImportRelative annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImportRelative annot -> r # gmapQ :: (forall d. Data d => d -> u) -> ImportRelative annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ImportRelative annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImportRelative annot -> m (ImportRelative annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportRelative annot -> m (ImportRelative annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportRelative annot -> m (ImportRelative annot) #
Ord annot => Ord (ImportRelative annot) # |
Methods compare :: ImportRelative annot -> ImportRelative annot -> Ordering # (<) :: ImportRelative annot -> ImportRelative annot -> Bool # (<=) :: ImportRelative annot -> ImportRelative annot -> Bool # (>) :: ImportRelative annot -> ImportRelative annot -> Bool # (>=) :: ImportRelative annot -> ImportRelative annot -> Bool # max :: ImportRelative annot -> ImportRelative annot -> ImportRelative annot # min :: ImportRelative annot -> ImportRelative annot -> ImportRelative annot #
Show annot => Show (ImportRelative annot) # |
Methods showsPrec :: Int -> ImportRelative annot -> ShowS # show :: ImportRelative annot -> String # showList :: [ImportRelative annot] -> ShowS #

type ImportRelativeSpan = ImportRelative SrcSpan #

# Exceptions

data Handler annot #

Exception handler.

Constructors

Handler |
Fields handler_clause :: ExceptClause annot handler_suite :: Suite annot handler_annot :: annot

Instances

Functor Handler # |
Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #
Span HandlerSpan # |
Methods getSpan :: HandlerSpan -> SrcSpan #
Annotated Handler # |
Methods annot :: Handler annot -> annot #
Eq annot => Eq (Handler annot) # |
Methods (==) :: Handler annot -> Handler annot -> Bool # (/=) :: Handler annot -> Handler annot -> Bool #
Data annot => Data (Handler annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Handler annot -> c (Handler annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Handler annot) # toConstr :: Handler annot -> Constr # dataTypeOf :: Handler annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Handler annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Handler annot)) # gmapT :: (forall b. Data b => b -> b) -> Handler annot -> Handler annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Handler annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Handler annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Handler annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Handler annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Handler annot -> m (Handler annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Handler annot -> m (Handler annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Handler annot -> m (Handler annot) #
Ord annot => Ord (Handler annot) # |
Methods compare :: Handler annot -> Handler annot -> Ordering # (<) :: Handler annot -> Handler annot -> Bool # (<=) :: Handler annot -> Handler annot -> Bool # (>) :: Handler annot -> Handler annot -> Bool # (>=) :: Handler annot -> Handler annot -> Bool # max :: Handler annot -> Handler annot -> Handler annot # min :: Handler annot -> Handler annot -> Handler annot #
Show annot => Show (Handler annot) # |
Methods showsPrec :: Int -> Handler annot -> ShowS # show :: Handler annot -> String # showList :: [Handler annot] -> ShowS #

type HandlerSpan = Handler SrcSpan #

data ExceptClause annot #

Exception clause.

Constructors

ExceptClause |
Fields except_clause :: Maybe (Expr annot, Maybe (Expr annot)) except_clause_annot :: annot

Instances

Functor ExceptClause # |
Methods fmap :: (a -> b) -> ExceptClause a -> ExceptClause b # (<$) :: a -> ExceptClause b -> ExceptClause a #
Span ExceptClauseSpan # |
Methods getSpan :: ExceptClauseSpan -> SrcSpan #
Annotated ExceptClause # |
Methods annot :: ExceptClause annot -> annot #
Eq annot => Eq (ExceptClause annot) # |
Methods (==) :: ExceptClause annot -> ExceptClause annot -> Bool # (/=) :: ExceptClause annot -> ExceptClause annot -> Bool #
Data annot => Data (ExceptClause annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ExceptClause annot -> c (ExceptClause annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ExceptClause annot) # toConstr :: ExceptClause annot -> Constr # dataTypeOf :: ExceptClause annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ExceptClause annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ExceptClause annot)) # gmapT :: (forall b. Data b => b -> b) -> ExceptClause annot -> ExceptClause annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ExceptClause annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ExceptClause annot -> r # gmapQ :: (forall d. Data d => d -> u) -> ExceptClause annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ExceptClause annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ExceptClause annot -> m (ExceptClause annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ExceptClause annot -> m (ExceptClause annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ExceptClause annot -> m (ExceptClause annot) #
Ord annot => Ord (ExceptClause annot) # |
Methods compare :: ExceptClause annot -> ExceptClause annot -> Ordering # (<) :: ExceptClause annot -> ExceptClause annot -> Bool # (<=) :: ExceptClause annot -> ExceptClause annot -> Bool # (>) :: ExceptClause annot -> ExceptClause annot -> Bool # (>=) :: ExceptClause annot -> ExceptClause annot -> Bool # max :: ExceptClause annot -> ExceptClause annot -> ExceptClause annot # min :: ExceptClause annot -> ExceptClause annot -> ExceptClause annot #
Show annot => Show (ExceptClause annot) # |
Methods showsPrec :: Int -> ExceptClause annot -> ShowS # show :: ExceptClause annot -> String # showList :: [ExceptClause annot] -> ShowS #

type ExceptClauseSpan = ExceptClause SrcSpan #

data RaiseExpr annot #

The argument for a `raise` statement.

Constructors

RaiseV3 (Maybe (Expr annot, Maybe (Expr annot))) | Optional expression to evaluate, and optional 'from' clause. Version 3 only.
RaiseV2 (Maybe (Expr annot, Maybe (Expr annot, Maybe (Expr annot)))) | Version 2 only.

Instances

Functor RaiseExpr # |
Methods fmap :: (a -> b) -> RaiseExpr a -> RaiseExpr b # (<$) :: a -> RaiseExpr b -> RaiseExpr a #
Eq annot => Eq (RaiseExpr annot) # |
Methods (==) :: RaiseExpr annot -> RaiseExpr annot -> Bool # (/=) :: RaiseExpr annot -> RaiseExpr annot -> Bool #
Data annot => Data (RaiseExpr annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RaiseExpr annot -> c (RaiseExpr annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RaiseExpr annot) # toConstr :: RaiseExpr annot -> Constr # dataTypeOf :: RaiseExpr annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (RaiseExpr annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RaiseExpr annot)) # gmapT :: (forall b. Data b => b -> b) -> RaiseExpr annot -> RaiseExpr annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RaiseExpr annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RaiseExpr annot -> r # gmapQ :: (forall d. Data d => d -> u) -> RaiseExpr annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RaiseExpr annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RaiseExpr annot -> m (RaiseExpr annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RaiseExpr annot -> m (RaiseExpr annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RaiseExpr annot -> m (RaiseExpr annot) #
Ord annot => Ord (RaiseExpr annot) # |
Methods compare :: RaiseExpr annot -> RaiseExpr annot -> Ordering # (<) :: RaiseExpr annot -> RaiseExpr annot -> Bool # (<=) :: RaiseExpr annot -> RaiseExpr annot -> Bool # (>) :: RaiseExpr annot -> RaiseExpr annot -> Bool # (>=) :: RaiseExpr annot -> RaiseExpr annot -> Bool # max :: RaiseExpr annot -> RaiseExpr annot -> RaiseExpr annot # min :: RaiseExpr annot -> RaiseExpr annot -> RaiseExpr annot #
Show annot => Show (RaiseExpr annot) # |
Methods showsPrec :: Int -> RaiseExpr annot -> ShowS # show :: RaiseExpr annot -> String # showList :: [RaiseExpr annot] -> ShowS #

type RaiseExprSpan = RaiseExpr SrcSpan #

# Comprehensions

data Comprehension annot #

Comprehension. In version 3.x this can be used for lists, sets, dictionaries and generators. data Comprehension e annot

Constructors

Comprehension |
Fields comprehension_expr :: ComprehensionExpr annot comprehension_for :: CompFor annot comprehension_annot :: annot

Instances

Functor Comprehension # |
Methods fmap :: (a -> b) -> Comprehension a -> Comprehension b # (<$) :: a -> Comprehension b -> Comprehension a #
Span ComprehensionSpan # |
Methods getSpan :: ComprehensionSpan -> SrcSpan #
Annotated Comprehension # |
Methods annot :: Comprehension annot -> annot #
Eq annot => Eq (Comprehension annot) # |
Methods (==) :: Comprehension annot -> Comprehension annot -> Bool # (/=) :: Comprehension annot -> Comprehension annot -> Bool #
Data annot => Data (Comprehension annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Comprehension annot -> c (Comprehension annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Comprehension annot) # toConstr :: Comprehension annot -> Constr # dataTypeOf :: Comprehension annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Comprehension annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Comprehension annot)) # gmapT :: (forall b. Data b => b -> b) -> Comprehension annot -> Comprehension annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Comprehension annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Comprehension annot -> r # gmapQ :: (forall d. Data d => d -> u) -> Comprehension annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Comprehension annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Comprehension annot -> m (Comprehension annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Comprehension annot -> m (Comprehension annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Comprehension annot -> m (Comprehension annot) #
Ord annot => Ord (Comprehension annot) # |
Methods compare :: Comprehension annot -> Comprehension annot -> Ordering # (<) :: Comprehension annot -> Comprehension annot -> Bool # (<=) :: Comprehension annot -> Comprehension annot -> Bool # (>) :: Comprehension annot -> Comprehension annot -> Bool # (>=) :: Comprehension annot -> Comprehension annot -> Bool # max :: Comprehension annot -> Comprehension annot -> Comprehension annot # min :: Comprehension annot -> Comprehension annot -> Comprehension annot #
Show annot => Show (Comprehension annot) # |
Methods showsPrec :: Int -> Comprehension annot -> ShowS # show :: Comprehension annot -> String # showList :: [Comprehension annot] -> ShowS #

type ComprehensionSpan = Comprehension SrcSpan #

data ComprehensionExpr annot #

Constructors

ComprehensionExpr (Expr annot) |
ComprehensionDict (DictMappingPair annot) |

Instances

Functor ComprehensionExpr # |
Methods fmap :: (a -> b) -> ComprehensionExpr a -> ComprehensionExpr b # (<$) :: a -> ComprehensionExpr b -> ComprehensionExpr a #
Span ComprehensionExprSpan # |
Methods getSpan :: ComprehensionExprSpan -> SrcSpan #
Eq annot => Eq (ComprehensionExpr annot) # |
Methods (==) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool # (/=) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool #
Data annot => Data (ComprehensionExpr annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ComprehensionExpr annot -> c (ComprehensionExpr annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ComprehensionExpr annot) # toConstr :: ComprehensionExpr annot -> Constr # dataTypeOf :: ComprehensionExpr annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (ComprehensionExpr annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ComprehensionExpr annot)) # gmapT :: (forall b. Data b => b -> b) -> ComprehensionExpr annot -> ComprehensionExpr annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ComprehensionExpr annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ComprehensionExpr annot -> r # gmapQ :: (forall d. Data d => d -> u) -> ComprehensionExpr annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ComprehensionExpr annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ComprehensionExpr annot -> m (ComprehensionExpr annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ComprehensionExpr annot -> m (ComprehensionExpr annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ComprehensionExpr annot -> m (ComprehensionExpr annot) #
Ord annot => Ord (ComprehensionExpr annot) # |
Methods compare :: ComprehensionExpr annot -> ComprehensionExpr annot -> Ordering # (<) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool # (<=) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool # (>) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool # (>=) :: ComprehensionExpr annot -> ComprehensionExpr annot -> Bool # max :: ComprehensionExpr annot -> ComprehensionExpr annot -> ComprehensionExpr annot # min :: ComprehensionExpr annot -> ComprehensionExpr annot -> ComprehensionExpr annot #
Show annot => Show (ComprehensionExpr annot) # |
Methods showsPrec :: Int -> ComprehensionExpr annot -> ShowS # show :: ComprehensionExpr annot -> String # showList :: [ComprehensionExpr annot] -> ShowS #

type ComprehensionExprSpan = ComprehensionExpr SrcSpan #

data CompFor annot #

Comprehension 'for' component.

Constructors

CompFor |
Fields comp_for_exprs :: [Expr annot] comp_in_expr :: Expr annot comp_for_iter :: Maybe (CompIter annot) comp_for_annot :: annot

Instances

Functor CompFor # |
Methods fmap :: (a -> b) -> CompFor a -> CompFor b # (<$) :: a -> CompFor b -> CompFor a #
Span CompForSpan # |
Methods getSpan :: CompForSpan -> SrcSpan #
Annotated CompFor # |
Methods annot :: CompFor annot -> annot #
Eq annot => Eq (CompFor annot) # |
Methods (==) :: CompFor annot -> CompFor annot -> Bool # (/=) :: CompFor annot -> CompFor annot -> Bool #
Data annot => Data (CompFor annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompFor annot -> c (CompFor annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CompFor annot) # toConstr :: CompFor annot -> Constr # dataTypeOf :: CompFor annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (CompFor annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CompFor annot)) # gmapT :: (forall b. Data b => b -> b) -> CompFor annot -> CompFor annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompFor annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompFor annot -> r # gmapQ :: (forall d. Data d => d -> u) -> CompFor annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CompFor annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompFor annot -> m (CompFor annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompFor annot -> m (CompFor annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompFor annot -> m (CompFor annot) #
Ord annot => Ord (CompFor annot) # |
Methods compare :: CompFor annot -> CompFor annot -> Ordering # (<) :: CompFor annot -> CompFor annot -> Bool # (<=) :: CompFor annot -> CompFor annot -> Bool # (>) :: CompFor annot -> CompFor annot -> Bool # (>=) :: CompFor annot -> CompFor annot -> Bool # max :: CompFor annot -> CompFor annot -> CompFor annot # min :: CompFor annot -> CompFor annot -> CompFor annot #
Show annot => Show (CompFor annot) # |
Methods showsPrec :: Int -> CompFor annot -> ShowS # show :: CompFor annot -> String # showList :: [CompFor annot] -> ShowS #

type CompForSpan = CompFor SrcSpan #

data CompIf annot #

Comprehension guard.

Constructors

CompIf |
Fields comp_if :: Expr annot comp_if_iter :: Maybe (CompIter annot) comp_if_annot :: annot

Instances

Functor CompIf # |
Methods fmap :: (a -> b) -> CompIf a -> CompIf b # (<$) :: a -> CompIf b -> CompIf a #
Span CompIfSpan # |
Methods getSpan :: CompIfSpan -> SrcSpan #
Annotated CompIf # |
Methods annot :: CompIf annot -> annot #
Eq annot => Eq (CompIf annot) # |
Methods (==) :: CompIf annot -> CompIf annot -> Bool # (/=) :: CompIf annot -> CompIf annot -> Bool #
Data annot => Data (CompIf annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompIf annot -> c (CompIf annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CompIf annot) # toConstr :: CompIf annot -> Constr # dataTypeOf :: CompIf annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (CompIf annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CompIf annot)) # gmapT :: (forall b. Data b => b -> b) -> CompIf annot -> CompIf annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompIf annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompIf annot -> r # gmapQ :: (forall d. Data d => d -> u) -> CompIf annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CompIf annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompIf annot -> m (CompIf annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompIf annot -> m (CompIf annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompIf annot -> m (CompIf annot) #
Ord annot => Ord (CompIf annot) # |
Methods compare :: CompIf annot -> CompIf annot -> Ordering # (<) :: CompIf annot -> CompIf annot -> Bool # (<=) :: CompIf annot -> CompIf annot -> Bool # (>) :: CompIf annot -> CompIf annot -> Bool # (>=) :: CompIf annot -> CompIf annot -> Bool # max :: CompIf annot -> CompIf annot -> CompIf annot # min :: CompIf annot -> CompIf annot -> CompIf annot #
Show annot => Show (CompIf annot) # |
Methods showsPrec :: Int -> CompIf annot -> ShowS # show :: CompIf annot -> String # showList :: [CompIf annot] -> ShowS #

type CompIfSpan = CompIf SrcSpan #

data CompIter annot #

Comprehension iterator (either a 'for' or an 'if').

Constructors

IterFor |
Fields comp_iter_for :: CompFor annot comp_iter_annot :: annot
IterIf |
Fields comp_iter_if :: CompIf annot comp_iter_annot :: annot

Instances

Functor CompIter # |
Methods fmap :: (a -> b) -> CompIter a -> CompIter b # (<$) :: a -> CompIter b -> CompIter a #
Span CompIterSpan # |
Methods getSpan :: CompIterSpan -> SrcSpan #
Annotated CompIter # |
Methods annot :: CompIter annot -> annot #
Eq annot => Eq (CompIter annot) # |
Methods (==) :: CompIter annot -> CompIter annot -> Bool # (/=) :: CompIter annot -> CompIter annot -> Bool #
Data annot => Data (CompIter annot) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CompIter annot -> c (CompIter annot) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (CompIter annot) # toConstr :: CompIter annot -> Constr # dataTypeOf :: CompIter annot -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (CompIter annot)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (CompIter annot)) # gmapT :: (forall b. Data b => b -> b) -> CompIter annot -> CompIter annot # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CompIter annot -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CompIter annot -> r # gmapQ :: (forall d. Data d => d -> u) -> CompIter annot -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CompIter annot -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CompIter annot -> m (CompIter annot) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CompIter annot -> m (CompIter annot) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CompIter annot -> m (CompIter annot) #
Ord annot => Ord (CompIter annot) # |
Methods compare :: CompIter annot -> CompIter annot -> Ordering # (<) :: CompIter annot -> CompIter annot -> Bool # (<=) :: CompIter annot -> CompIter annot -> Bool # (>) :: CompIter annot -> CompIter annot -> Bool # (>=) :: CompIter annot -> CompIter annot -> Bool # max :: CompIter annot -> CompIter annot -> CompIter annot # min :: CompIter annot -> CompIter annot -> CompIter annot #
Show annot => Show (CompIter annot) # |
Methods showsPrec :: Int -> CompIter annot -> ShowS # show :: CompIter annot -> String # showList :: [CompIter annot] -> ShowS #

type CompIterSpan = CompIter SrcSpan #