Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module only exists as our current best solution to decoupling parts of the concrete syntax from abstract syntax. You won't need to care about its existence and hopefully it will be deleted soon.
Documentation
class AsIRError s a | s -> a where Source #
_InvalidUnpacking :: Prism' s a Source #
Instances
AsIRError (ParseError a) a Source # | |
Defined in Language.Python.Parse.Error _InvalidUnpacking :: Prism' (ParseError a) a Source # |
InvalidUnpacking a | Unpacking ( |
fromIRError :: AsIRError s a => IRError a -> s Source #
data SmallStatement a Source #
MkSmallStatement (SimpleStatement a) [(Semicolon a, SimpleStatement a)] (Maybe (Semicolon a)) (Maybe (Comment a)) (Maybe Newline) |
Instances
Instances
Functor Statement Source # | |
Foldable Statement Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Statement m -> m # foldMap :: Monoid m => (a -> m) -> Statement a -> m # foldr :: (a -> b -> b) -> b -> Statement a -> b # foldr' :: (a -> b -> b) -> b -> Statement a -> b # foldl :: (b -> a -> b) -> b -> Statement a -> b # foldl' :: (b -> a -> b) -> b -> Statement a -> b # foldr1 :: (a -> a -> a) -> Statement a -> a # foldl1 :: (a -> a -> a) -> Statement a -> a # toList :: Statement a -> [a] # length :: Statement a -> Int # elem :: Eq a => a -> Statement a -> Bool # maximum :: Ord a => Statement a -> a # minimum :: Ord a => Statement a -> a # | |
Traversable Statement Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (Statement a) Source # | |
Show a => Show (Statement a) Source # | |
data CompoundStatement a Source #
Instances
data SimpleStatement a Source #
Return a [Whitespace] (Maybe (Expr a)) | |
Expr a (Expr a) | |
Assign a (Expr a) (NonEmpty (Equals, Expr a)) | |
AugAssign a (Expr a) (AugAssign a) (Expr a) | |
Pass a [Whitespace] | |
Break a [Whitespace] | |
Continue a [Whitespace] | |
Global a (NonEmpty Whitespace) (CommaSep1 (Ident '[] a)) | |
Nonlocal a (NonEmpty Whitespace) (CommaSep1 (Ident '[] a)) | |
Del a [Whitespace] (CommaSep1' (Expr a)) | |
Import a (NonEmpty Whitespace) (CommaSep1 (ImportAs (ModuleName '[]) '[] a)) | |
From a [Whitespace] (RelativeModuleName '[] a) [Whitespace] (ImportTargets '[] a) | |
Raise a [Whitespace] (Maybe (Expr a, Maybe ([Whitespace], Expr a))) | |
Assert a [Whitespace] (Expr a) (Maybe (Comma, Expr a)) |
Instances
PositionalParam | |
| |
KeywordParam | |
| |
StarParam | |
| |
UnnamedStarParam | |
DoubleStarParam | |
|
Instances
Functor Param Source # | |
Foldable Param Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Param m -> m # foldMap :: Monoid m => (a -> m) -> Param a -> m # foldr :: (a -> b -> b) -> b -> Param a -> b # foldr' :: (a -> b -> b) -> b -> Param a -> b # foldl :: (b -> a -> b) -> b -> Param a -> b # foldl' :: (b -> a -> b) -> b -> Param a -> b # foldr1 :: (a -> a -> a) -> Param a -> a # foldl1 :: (a -> a -> a) -> Param a -> a # elem :: Eq a => a -> Param a -> Bool # maximum :: Ord a => Param a -> a # minimum :: Ord a => Param a -> a # | |
Traversable Param Source # | |
Eq a => Eq (Param a) Source # | |
Show a => Show (Param a) Source # | |
CompIf a [Whitespace] (Expr a) | 'if' any_spaces expr |
Instances
Functor CompIf Source # | |
Foldable CompIf Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => CompIf m -> m # foldMap :: Monoid m => (a -> m) -> CompIf a -> m # foldr :: (a -> b -> b) -> b -> CompIf a -> b # foldr' :: (a -> b -> b) -> b -> CompIf a -> b # foldl :: (b -> a -> b) -> b -> CompIf a -> b # foldl' :: (b -> a -> b) -> b -> CompIf a -> b # foldr1 :: (a -> a -> a) -> CompIf a -> a # foldl1 :: (a -> a -> a) -> CompIf a -> a # elem :: Eq a => a -> CompIf a -> Bool # maximum :: Ord a => CompIf a -> a # minimum :: Ord a => CompIf a -> a # | |
Traversable CompIf Source # | |
Eq a => Eq (CompIf a) Source # | |
Show a => Show (CompIf a) Source # | |
CompFor a [Whitespace] (Expr a) [Whitespace] (Expr a) |
|
Instances
Functor CompFor Source # | |
Foldable CompFor Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => CompFor m -> m # foldMap :: Monoid m => (a -> m) -> CompFor a -> m # foldr :: (a -> b -> b) -> b -> CompFor a -> b # foldr' :: (a -> b -> b) -> b -> CompFor a -> b # foldl :: (b -> a -> b) -> b -> CompFor a -> b # foldl' :: (b -> a -> b) -> b -> CompFor a -> b # foldr1 :: (a -> a -> a) -> CompFor a -> a # foldl1 :: (a -> a -> a) -> CompFor a -> a # elem :: Eq a => a -> CompFor a -> Bool # maximum :: Ord a => CompFor a -> a # minimum :: Ord a => CompFor a -> a # | |
Traversable CompFor Source # | |
Eq a => Eq (CompFor a) Source # | |
Show a => Show (CompFor a) Source # | |
data Comprehension e a Source #
Comprehension a (e a) (CompFor a) [Either (CompFor a) (CompIf a)] |
Instances
SubscriptExpr (Expr a) | |
SubscriptSlice (Maybe (Expr a)) Colon (Maybe (Expr a)) (Maybe (Colon, Maybe (Expr a))) |
Instances
Functor Subscript Source # | |
Foldable Subscript Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Subscript m -> m # foldMap :: Monoid m => (a -> m) -> Subscript a -> m # foldr :: (a -> b -> b) -> b -> Subscript a -> b # foldr' :: (a -> b -> b) -> b -> Subscript a -> b # foldl :: (b -> a -> b) -> b -> Subscript a -> b # foldl' :: (b -> a -> b) -> b -> Subscript a -> b # foldr1 :: (a -> a -> a) -> Subscript a -> a # foldl1 :: (a -> a -> a) -> Subscript a -> a # toList :: Subscript a -> [a] # length :: Subscript a -> Int # elem :: Eq a => a -> Subscript a -> Bool # maximum :: Ord a => Subscript a -> a # minimum :: Ord a => Subscript a -> a # | |
Traversable Subscript Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (Subscript a) Source # | |
Show a => Show (Subscript a) Source # | |
DictItem | |
| |
DictUnpack | |
Instances
Functor DictItem Source # | |
Foldable DictItem Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => DictItem m -> m # foldMap :: Monoid m => (a -> m) -> DictItem a -> m # foldr :: (a -> b -> b) -> b -> DictItem a -> b # foldr' :: (a -> b -> b) -> b -> DictItem a -> b # foldl :: (b -> a -> b) -> b -> DictItem a -> b # foldl' :: (b -> a -> b) -> b -> DictItem a -> b # foldr1 :: (a -> a -> a) -> DictItem a -> a # foldl1 :: (a -> a -> a) -> DictItem a -> a # elem :: Eq a => a -> DictItem a -> Bool # maximum :: Ord a => DictItem a -> a # minimum :: Ord a => DictItem a -> a # | |
Traversable DictItem Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (DictItem a) Source # | |
Show a => Show (DictItem a) Source # | |
PositionalArg | |
KeywordArg | |
| |
StarArg | |
| |
DoubleStarArg | |
|
Instances
Functor Arg Source # | |
Foldable Arg Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Arg m -> m # foldMap :: Monoid m => (a -> m) -> Arg a -> m # foldr :: (a -> b -> b) -> b -> Arg a -> b # foldr' :: (a -> b -> b) -> b -> Arg a -> b # foldl :: (b -> a -> b) -> b -> Arg a -> b # foldl' :: (b -> a -> b) -> b -> Arg a -> b # foldr1 :: (a -> a -> a) -> Arg a -> a # foldl1 :: (a -> a -> a) -> Arg a -> a # elem :: Eq a => a -> Arg a -> Bool # maximum :: Ord a => Arg a -> a # | |
Traversable Arg Source # | |
Eq a => Eq (Arg a) Source # | |
Show a => Show (Arg a) Source # | |
Instances
Functor Expr Source # | |
Foldable Expr Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Expr m -> m # foldMap :: Monoid m => (a -> m) -> Expr a -> m # foldr :: (a -> b -> b) -> b -> Expr a -> b # foldr' :: (a -> b -> b) -> b -> Expr a -> b # foldl :: (b -> a -> b) -> b -> Expr a -> b # foldl' :: (b -> a -> b) -> b -> Expr a -> b # foldr1 :: (a -> a -> a) -> Expr a -> a # foldl1 :: (a -> a -> a) -> Expr a -> a # elem :: Eq a => a -> Expr a -> Bool # maximum :: Ord a => Expr a -> a # | |
Traversable Expr Source # | |
Eq a => Eq (Expr a) Source # | |
Show a => Show (Expr a) Source # | |
Instances
Functor Suite Source # | |
Foldable Suite Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Suite m -> m # foldMap :: Monoid m => (a -> m) -> Suite a -> m # foldr :: (a -> b -> b) -> b -> Suite a -> b # foldr' :: (a -> b -> b) -> b -> Suite a -> b # foldl :: (b -> a -> b) -> b -> Suite a -> b # foldl' :: (b -> a -> b) -> b -> Suite a -> b # foldr1 :: (a -> a -> a) -> Suite a -> a # foldl1 :: (a -> a -> a) -> Suite a -> a # elem :: Eq a => a -> Suite a -> Bool # maximum :: Ord a => Suite a -> a # minimum :: Ord a => Suite a -> a # | |
Traversable Suite Source # | |
Eq a => Eq (Suite a) Source # | |
Show a => Show (Suite a) Source # | |
Block | |
|
Instances
Functor Block Source # | |
Foldable Block Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Block m -> m # foldMap :: Monoid m => (a -> m) -> Block a -> m # foldr :: (a -> b -> b) -> b -> Block a -> b # foldr' :: (a -> b -> b) -> b -> Block a -> b # foldl :: (b -> a -> b) -> b -> Block a -> b # foldl' :: (b -> a -> b) -> b -> Block a -> b # foldr1 :: (a -> a -> a) -> Block a -> a # foldl1 :: (a -> a -> a) -> Block a -> a # elem :: Eq a => a -> Block a -> Bool # maximum :: Ord a => Block a -> a # minimum :: Ord a => Block a -> a # | |
Traversable Block Source # | |
Eq a => Eq (Block a) Source # | |
Show a => Show (Block a) Source # | |
WithItem | |
|
Instances
Functor WithItem Source # | |
Foldable WithItem Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => WithItem m -> m # foldMap :: Monoid m => (a -> m) -> WithItem a -> m # foldr :: (a -> b -> b) -> b -> WithItem a -> b # foldr' :: (a -> b -> b) -> b -> WithItem a -> b # foldl :: (b -> a -> b) -> b -> WithItem a -> b # foldl' :: (b -> a -> b) -> b -> WithItem a -> b # foldr1 :: (a -> a -> a) -> WithItem a -> a # foldl1 :: (a -> a -> a) -> WithItem a -> a # elem :: Eq a => a -> WithItem a -> Bool # maximum :: Ord a => WithItem a -> a # minimum :: Ord a => WithItem a -> a # | |
Traversable WithItem Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (WithItem a) Source # | |
Show a => Show (WithItem a) Source # | |
Decorator | |
|
Instances
Functor Decorator Source # | |
Foldable Decorator Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Decorator m -> m # foldMap :: Monoid m => (a -> m) -> Decorator a -> m # foldr :: (a -> b -> b) -> b -> Decorator a -> b # foldr' :: (a -> b -> b) -> b -> Decorator a -> b # foldl :: (b -> a -> b) -> b -> Decorator a -> b # foldl' :: (b -> a -> b) -> b -> Decorator a -> b # foldr1 :: (a -> a -> a) -> Decorator a -> a # foldl1 :: (a -> a -> a) -> Decorator a -> a # toList :: Decorator a -> [a] # length :: Decorator a -> Int # elem :: Eq a => a -> Decorator a -> Bool # maximum :: Ord a => Decorator a -> a # minimum :: Ord a => Decorator a -> a # | |
Traversable Decorator Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (Decorator a) Source # | |
Show a => Show (Decorator a) Source # | |
ExceptAs | |
|
Instances
Functor ExceptAs Source # | |
Foldable ExceptAs Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => ExceptAs m -> m # foldMap :: Monoid m => (a -> m) -> ExceptAs a -> m # foldr :: (a -> b -> b) -> b -> ExceptAs a -> b # foldr' :: (a -> b -> b) -> b -> ExceptAs a -> b # foldl :: (b -> a -> b) -> b -> ExceptAs a -> b # foldl' :: (b -> a -> b) -> b -> ExceptAs a -> b # foldr1 :: (a -> a -> a) -> ExceptAs a -> a # foldl1 :: (a -> a -> a) -> ExceptAs a -> a # elem :: Eq a => a -> ExceptAs a -> Bool # maximum :: Ord a => ExceptAs a -> a # minimum :: Ord a => ExceptAs a -> a # | |
Traversable ExceptAs Source # | |
Defined in Language.Python.Internal.Syntax.IR | |
Eq a => Eq (ExceptAs a) Source # | |
Show a => Show (ExceptAs a) Source # | |
ModuleEmpty | |
ModuleBlankFinal (Blank a) | |
ModuleBlank (Blank a) Newline (Module a) | |
ModuleStatement (Statement a) (Module a) |
Instances
Functor Module Source # | |
Foldable Module Source # | |
Defined in Language.Python.Internal.Syntax.IR fold :: Monoid m => Module m -> m # foldMap :: Monoid m => (a -> m) -> Module a -> m # foldr :: (a -> b -> b) -> b -> Module a -> b # foldr' :: (a -> b -> b) -> b -> Module a -> b # foldl :: (b -> a -> b) -> b -> Module a -> b # foldl' :: (b -> a -> b) -> b -> Module a -> b # foldr1 :: (a -> a -> a) -> Module a -> a # foldl1 :: (a -> a -> a) -> Module a -> a # elem :: Eq a => a -> Module a -> Bool # maximum :: Ord a => Module a -> a # minimum :: Ord a => Module a -> a # | |
Traversable Module Source # | |
Eq a => Eq (Module a) Source # | |
Show a => Show (Module a) Source # | |
allowStarred :: Iso' FromIRContext Bool Source #
fromIR_decorator :: AsIRError e a => Decorator a -> Validation (NonEmpty e) (Decorator '[] a) Source #
fromIR_comprehension :: AsIRError e a => (ex a -> Validation (NonEmpty e) (ex' '[] a)) -> Comprehension ex a -> Validation (NonEmpty e) (Comprehension ex' '[] a) Source #
fromIR_subscript :: AsIRError e a => Subscript a -> Validation (NonEmpty e) (Subscript '[] a) Source #
fromIR_smallStatement :: AsIRError e a => SmallStatement a -> Validation (NonEmpty e) (SmallStatement '[] a) Source #
fromIR_statement :: AsIRError e a => Statement a -> Validation (NonEmpty e) (Statement '[] a) Source #
fromIR_SimpleStatement :: AsIRError e a => SimpleStatement a -> Validation (NonEmpty e) (SimpleStatement '[] a) Source #
fromIR_compoundStatement :: AsIRError e a => CompoundStatement a -> Validation (NonEmpty e) (CompoundStatement '[] a) Source #