Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Datatypes for different parts of Python syntax
Synopsis
- data PositionalParam v a = MkPositionalParam {}
- ppAnn :: forall v a. Lens' (PositionalParam v a) a
- ppName :: forall v a. Lens' (PositionalParam v a) (Ident v a)
- ppType :: forall v a. Lens' (PositionalParam v a) (Maybe (Colon, Expr v a))
- data StarParam v a = MkStarParam {
- _spAnn :: a
- _spWhitespace :: [Whitespace]
- _spName :: Ident v a
- _spType :: Maybe (Colon, Expr v a)
- spAnn :: forall v a. Lens' (StarParam v a) a
- spWhitespace :: forall v a. Lens' (StarParam v a) [Whitespace]
- spName :: forall v a. Lens' (StarParam v a) (Ident v a)
- spType :: forall v a. Lens' (StarParam v a) (Maybe (Colon, Expr v a))
- data UnnamedStarParam (v :: [*]) a = MkUnnamedStarParam {
- _uspAnn :: a
- _uspWhitespace :: [Whitespace]
- uspAnn :: forall v a v a. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) a a
- uspWhitespace :: forall v a v. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) [Whitespace] [Whitespace]
- data KeywordParam v a = MkKeywordParam {}
- kpAnn :: forall v a. Lens' (KeywordParam v a) a
- kpName :: forall v a. Lens' (KeywordParam v a) (Ident v a)
- kpType :: forall v a. Lens' (KeywordParam v a) (Maybe (Colon, Expr v a))
- kpEquals :: forall v a. Lens' (KeywordParam v a) [Whitespace]
- kpExpr :: forall v a. Lens' (KeywordParam v a) (Expr v a)
- data Fundef v a = MkFundef {
- _fdAnn :: a
- _fdDecorators :: [Decorator v a]
- _fdIndents :: Indents a
- _fdAsync :: Maybe (NonEmpty Whitespace)
- _fdDefSpaces :: NonEmpty Whitespace
- _fdName :: Ident v a
- _fdLeftParenSpaces :: [Whitespace]
- _fdParameters :: CommaSep (Param v a)
- _fdRightParenSpaces :: [Whitespace]
- _fdReturnType :: Maybe ([Whitespace], Expr v a)
- _fdBody :: Suite v a
- fdAnn :: forall v a. Lens' (Fundef v a) a
- fdDecorators :: forall v a. Lens' (Fundef v a) [Decorator v a]
- fdIndents :: forall v a. Lens' (Fundef v a) (Indents a)
- fdAsync :: forall v a. Lens' (Fundef v a) (Maybe (NonEmpty Whitespace))
- fdDefSpaces :: forall v a. Lens' (Fundef v a) (NonEmpty Whitespace)
- fdName :: forall v a. Lens' (Fundef v a) (Ident v a)
- fdLeftParenSpaces :: forall v a. Lens' (Fundef v a) [Whitespace]
- fdParameters :: forall v a. Lens' (Fundef v a) (CommaSep (Param v a))
- fdRightParenSpaces :: forall v a. Lens' (Fundef v a) [Whitespace]
- fdReturnType :: forall v a. Lens' (Fundef v a) (Maybe ([Whitespace], Expr v a))
- fdBody :: forall v a. Lens' (Fundef v a) (Suite v a)
- data ClassDef v a = MkClassDef {
- _cdAnn :: a
- _cdDecorators :: [Decorator v a]
- _cdIndents :: Indents a
- _cdClass :: NonEmpty Whitespace
- _cdName :: Ident v a
- _cdArguments :: Maybe ([Whitespace], Maybe (CommaSep1' (Arg v a)), [Whitespace])
- _cdBody :: Suite v a
- cdAnn :: forall v a. Lens' (ClassDef v a) a
- cdDecorators :: forall v a. Lens' (ClassDef v a) [Decorator v a]
- cdIndents :: forall v a. Lens' (ClassDef v a) (Indents a)
- cdClass :: forall v a. Lens' (ClassDef v a) (NonEmpty Whitespace)
- cdName :: forall v a. Lens' (ClassDef v a) (Ident v a)
- cdArguments :: forall v a. Lens' (ClassDef v a) (Maybe ([Whitespace], Maybe (CommaSep1' (Arg v a)), [Whitespace]))
- cdBody :: forall v a. Lens' (ClassDef v a) (Suite v a)
- data If v a = MkIf {}
- ifAnn :: forall v a. Lens' (If v a) a
- ifIndents :: forall v a. Lens' (If v a) (Indents a)
- ifIf :: forall v a. Lens' (If v a) [Whitespace]
- ifCond :: forall v a. Lens' (If v a) (Expr v a)
- ifBody :: forall v a. Lens' (If v a) (Suite v a)
- ifElifs :: forall v a. Lens' (If v a) [Elif v a]
- ifElse :: forall v a. Lens' (If v a) (Maybe (Else v a))
- data Elif v a = MkElif {
- _elifIndents :: Indents a
- _elifElif :: [Whitespace]
- _elifCond :: Expr v a
- _elifBody :: Suite v a
- elifIndents :: forall v a. Lens' (Elif v a) (Indents a)
- elifElif :: forall v a. Lens' (Elif v a) [Whitespace]
- elifCond :: forall v a. Lens' (Elif v a) (Expr v a)
- elifBody :: forall v a. Lens' (Elif v a) (Suite v a)
- data For v a = MkFor {
- _forAnn :: a
- _forIndents :: Indents a
- _forAsync :: Maybe (NonEmpty Whitespace)
- _forFor :: [Whitespace]
- _forBinder :: Expr v a
- _forIn :: [Whitespace]
- _forCollection :: CommaSep1' (Expr v a)
- _forBody :: Suite v a
- _forElse :: Maybe (Else v a)
- forAnn :: forall v a. Lens' (For v a) a
- forIndents :: forall v a. Lens' (For v a) (Indents a)
- forAsync :: forall v a. Lens' (For v a) (Maybe (NonEmpty Whitespace))
- forFor :: forall v a. Lens' (For v a) [Whitespace]
- forBinder :: forall v a. Lens' (For v a) (Expr v a)
- forIn :: forall v a. Lens' (For v a) [Whitespace]
- forCollection :: forall v a. Lens' (For v a) (CommaSep1' (Expr v a))
- forBody :: forall v a. Lens' (For v a) (Suite v a)
- forElse :: forall v a. Lens' (For v a) (Maybe (Else v a))
- data While v a = MkWhile {
- _whileAnn :: a
- _whileIndents :: Indents a
- _whileWhile :: [Whitespace]
- _whileCond :: Expr v a
- _whileBody :: Suite v a
- _whileElse :: Maybe (Else v a)
- whileAnn :: forall v a. Lens' (While v a) a
- whileIndents :: forall v a. Lens' (While v a) (Indents a)
- whileWhile :: forall v a. Lens' (While v a) [Whitespace]
- whileCond :: forall v a. Lens' (While v a) (Expr v a)
- whileBody :: forall v a. Lens' (While v a) (Suite v a)
- whileElse :: forall v a. Lens' (While v a) (Maybe (Else v a))
- data TryExcept v a = MkTryExcept {
- _teAnn :: a
- _teIndents :: Indents a
- _teTry :: [Whitespace]
- _teBody :: Suite v a
- _teExcepts :: NonEmpty (Except v a)
- _teElse :: Maybe (Else v a)
- _teFinally :: Maybe (Finally v a)
- teAnn :: forall v a. Lens' (TryExcept v a) a
- teIndents :: forall v a. Lens' (TryExcept v a) (Indents a)
- teTry :: forall v a. Lens' (TryExcept v a) [Whitespace]
- teBody :: forall v a. Lens' (TryExcept v a) (Suite v a)
- teExcepts :: forall v a. Lens' (TryExcept v a) (NonEmpty (Except v a))
- teElse :: forall v a. Lens' (TryExcept v a) (Maybe (Else v a))
- teFinally :: forall v a. Lens' (TryExcept v a) (Maybe (Finally v a))
- data Except v a = MkExcept {
- _exceptIndents :: Indents a
- _exceptExcept :: [Whitespace]
- _exceptExceptAs :: Maybe (ExceptAs v a)
- _exceptBody :: Suite v a
- exceptIndents :: forall v a. Lens' (Except v a) (Indents a)
- exceptExcept :: forall v a. Lens' (Except v a) [Whitespace]
- exceptExceptAs :: forall v a. Lens' (Except v a) (Maybe (ExceptAs v a))
- exceptBody :: forall v a. Lens' (Except v a) (Suite v a)
- data TryFinally v a = MkTryFinally {
- _tfAnn :: a
- _tfIndents :: Indents a
- _tfTry :: [Whitespace]
- _tfBody :: Suite v a
- _tfFinally :: Finally v a
- tfAnn :: forall v a. Lens' (TryFinally v a) a
- tfIndents :: forall v a. Lens' (TryFinally v a) (Indents a)
- tfTry :: forall v a. Lens' (TryFinally v a) [Whitespace]
- tfBody :: forall v a. Lens' (TryFinally v a) (Suite v a)
- tfFinally :: forall v a. Lens' (TryFinally v a) (Finally v a)
- data Finally v a = MkFinally {
- _finallyIndents :: Indents a
- _finallyFinally :: [Whitespace]
- _finallyBody :: Suite v a
- finallyIndents :: forall v a. Lens' (Finally v a) (Indents a)
- finallyFinally :: forall v a. Lens' (Finally v a) [Whitespace]
- finallyBody :: forall v a v. Lens (Finally v a) (Finally v a) (Suite v a) (Suite v a)
- data With v a = MkWith {
- _withAnn :: a
- _withIndents :: Indents a
- _withAsync :: Maybe (NonEmpty Whitespace)
- _withWith :: [Whitespace]
- _withItems :: CommaSep1 (WithItem v a)
- _withBody :: Suite v a
- withAnn :: forall v a. Lens' (With v a) a
- withIndents :: forall v a. Lens' (With v a) (Indents a)
- withAsync :: forall v a. Lens' (With v a) (Maybe (NonEmpty Whitespace))
- withWith :: forall v a. Lens' (With v a) [Whitespace]
- withItems :: forall v a. Lens' (With v a) (CommaSep1 (WithItem v a))
- withBody :: forall v a. Lens' (With v a) (Suite v a)
- data Else v a = MkElse {
- _elseIndents :: Indents a
- _elseElse :: [Whitespace]
- _elseBody :: Suite v a
- elseIndents :: forall v a. Lens' (Else v a) (Indents a)
- elseElse :: forall v a. Lens' (Else v a) [Whitespace]
- elseBody :: forall v a v. Lens (Else v a) (Else v a) (Suite v a) (Suite v a)
- data None (v :: [*]) a = MkNone {
- _noneAnn :: a
- _noneWhitespace :: [Whitespace]
- noneAnn :: forall v a v a. Lens (None v a) (None v a) a a
- noneWhitespace :: forall v a v. Lens (None v a) (None v a) [Whitespace] [Whitespace]
- data Call v a = MkCall {
- _callAnn :: a
- _callFunction :: Expr v a
- _callLeftParen :: [Whitespace]
- _callArguments :: Maybe (CommaSep1' (Arg v a))
- _callRightParen :: [Whitespace]
- callAnn :: forall v a. Lens' (Call v a) a
- callFunction :: forall v a. Lens' (Call v a) (Expr v a)
- callLeftParen :: forall v a. Lens' (Call v a) [Whitespace]
- callArguments :: forall v a. Lens' (Call v a) (Maybe (CommaSep1' (Arg v a)))
- callRightParen :: forall v a. Lens' (Call v a) [Whitespace]
- data Tuple v a = MkTuple {
- _tupleAnn :: a
- _tupleHead :: TupleItem v a
- _tupleComma :: Comma
- _tupleTail :: Maybe (CommaSep1' (TupleItem v a))
- tupleAnn :: forall v a. Lens' (Tuple v a) a
- tupleHead :: forall v a. Lens' (Tuple v a) (TupleItem v a)
- tupleComma :: forall v a. Lens' (Tuple v a) Comma
- tupleTail :: forall v a. Lens' (Tuple v a) (Maybe (CommaSep1' (TupleItem v a)))
- data TupleUnpack v a = MkTupleUnpack {
- _tupleUnpackAnn :: a
- _tupleUnpackParens :: [([Whitespace], [Whitespace])]
- _tupleUnpackWhitespace :: [Whitespace]
- _tupleUnpackValue :: Expr v a
- tupleUnpackAnn :: forall v a. Lens' (TupleUnpack v a) a
- tupleUnpackParens :: forall v a. Lens' (TupleUnpack v a) [([Whitespace], [Whitespace])]
- tupleUnpackWhitespace :: forall v a. Lens' (TupleUnpack v a) [Whitespace]
- tupleUnpackValue :: forall v a v. Lens (TupleUnpack v a) (TupleUnpack v a) (Expr v a) (Expr v a)
- data List v a = MkList {
- _listAnn :: a
- _listWhitespaceLeft :: [Whitespace]
- _listBody :: Maybe (CommaSep1' (ListItem v a))
- _listWhitespaceRight :: [Whitespace]
- listAnn :: forall v a. Lens' (List v a) a
- listWhitespaceLeft :: forall v a. Lens' (List v a) [Whitespace]
- listBody :: forall v a v. Lens (List v a) (List v a) (Maybe (CommaSep1' (ListItem v a))) (Maybe (CommaSep1' (ListItem v a)))
- listWhitespaceRight :: forall v a. Lens' (List v a) [Whitespace]
- data ListUnpack v a = MkListUnpack {
- _listUnpackAnn :: a
- _listUnpackParens :: [([Whitespace], [Whitespace])]
- _listUnpackWhitespace :: [Whitespace]
- _listUnpackValue :: Expr v a
- listUnpackAnn :: forall v a. Lens' (ListUnpack v a) a
- listUnpackParens :: forall v a. Lens' (ListUnpack v a) [([Whitespace], [Whitespace])]
- listUnpackWhitespace :: forall v a. Lens' (ListUnpack v a) [Whitespace]
- listUnpackValue :: forall v a v. Lens (ListUnpack v a) (ListUnpack v a) (Expr v a) (Expr v a)
Parameters
Positional parameters
data PositionalParam v a Source #
Instances
Eq a => Eq (PositionalParam v a) Source # | |
Defined in Language.Python.Syntax.Types (==) :: PositionalParam v a -> PositionalParam v a -> Bool # (/=) :: PositionalParam v a -> PositionalParam v a -> Bool # | |
Show a => Show (PositionalParam v a) Source # | |
Defined in Language.Python.Syntax.Types showsPrec :: Int -> PositionalParam v a -> ShowS # show :: PositionalParam v a -> String # showList :: [PositionalParam v a] -> ShowS # |
Lenses
ppAnn :: forall v a. Lens' (PositionalParam v a) a Source #
ppName :: forall v a. Lens' (PositionalParam v a) (Ident v a) Source #
Starred Parameters
MkStarParam | |
|
Lenses
spWhitespace :: forall v a. Lens' (StarParam v a) [Whitespace] Source #
Unnamed Starred Parameters
data UnnamedStarParam (v :: [*]) a Source #
MkUnnamedStarParam | |
|
Instances
Eq a => Eq (UnnamedStarParam v a) Source # | |
Defined in Language.Python.Syntax.Types (==) :: UnnamedStarParam v a -> UnnamedStarParam v a -> Bool # (/=) :: UnnamedStarParam v a -> UnnamedStarParam v a -> Bool # | |
Show a => Show (UnnamedStarParam v a) Source # | |
Defined in Language.Python.Syntax.Types showsPrec :: Int -> UnnamedStarParam v a -> ShowS # show :: UnnamedStarParam v a -> String # showList :: [UnnamedStarParam v a] -> ShowS # |
Lenses
uspAnn :: forall v a v a. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) a a Source #
uspWhitespace :: forall v a v. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) [Whitespace] [Whitespace] Source #
Keyword parameters
data KeywordParam v a Source #
Instances
Eq a => Eq (KeywordParam v a) Source # | |
Defined in Language.Python.Syntax.Types (==) :: KeywordParam v a -> KeywordParam v a -> Bool # (/=) :: KeywordParam v a -> KeywordParam v a -> Bool # | |
Show a => Show (KeywordParam v a) Source # | |
Defined in Language.Python.Syntax.Types showsPrec :: Int -> KeywordParam v a -> ShowS # show :: KeywordParam v a -> String # showList :: [KeywordParam v a] -> ShowS # |
Lenses
kpAnn :: forall v a. Lens' (KeywordParam v a) a Source #
kpName :: forall v a. Lens' (KeywordParam v a) (Ident v a) Source #
kpEquals :: forall v a. Lens' (KeywordParam v a) [Whitespace] Source #
kpExpr :: forall v a. Lens' (KeywordParam v a) (Expr v a) Source #
Compound statements
Function definitions
MkFundef | |
|
Lenses
fdDecorators :: forall v a. Lens' (Fundef v a) [Decorator v a] Source #
fdDefSpaces :: forall v a. Lens' (Fundef v a) (NonEmpty Whitespace) Source #
fdLeftParenSpaces :: forall v a. Lens' (Fundef v a) [Whitespace] Source #
fdRightParenSpaces :: forall v a. Lens' (Fundef v a) [Whitespace] Source #
fdReturnType :: forall v a. Lens' (Fundef v a) (Maybe ([Whitespace], Expr v a)) Source #
Class definitions
MkClassDef | |
|
Lenses
cdDecorators :: forall v a. Lens' (ClassDef v a) [Decorator v a] Source #
cdArguments :: forall v a. Lens' (ClassDef v a) (Maybe ([Whitespace], Maybe (CommaSep1' (Arg v a)), [Whitespace])) Source #
if
statements
Lenses
ifIf :: forall v a. Lens' (If v a) [Whitespace] Source #
elif
MkElif | |
|
Lenses
elifIndents :: forall v a. Lens' (Elif v a) (Indents a) Source #
elifElif :: forall v a. Lens' (Elif v a) [Whitespace] Source #
for
statements
MkFor | |
|
Lenses
forIndents :: forall v a. Lens' (For v a) (Indents a) Source #
forFor :: forall v a. Lens' (For v a) [Whitespace] Source #
forIn :: forall v a. Lens' (For v a) [Whitespace] Source #
forCollection :: forall v a. Lens' (For v a) (CommaSep1' (Expr v a)) Source #
while
statements
MkWhile | |
|
Lenses
whileIndents :: forall v a. Lens' (While v a) (Indents a) Source #
whileWhile :: forall v a. Lens' (While v a) [Whitespace] Source #
try ... except ... else ... finally
MkTryExcept | |
|
Instances
HasTryExcept TryExcept Source # | |
Defined in Language.Python.Optics | |
ElseSyntax TryExcept Source # | |
BodySyntax TryExcept Source # | |
AsLine TryExcept Source # | |
ExceptSyntax (Raw TryExcept) Source # |
(someTryStatement :: (someTryStatement :: |
FinallySyntax (Raw TryExcept) TryExcept Source # |
|
Eq a => Eq (TryExcept v a) Source # | |
Show a => Show (TryExcept v a) Source # | |
HasIndents (TryExcept ([] :: [Type]) a) a Source # | |
Lenses
teTry :: forall v a. Lens' (TryExcept v a) [Whitespace] Source #
except
MkExcept | |
|
Lenses
exceptIndents :: forall v a. Lens' (Except v a) (Indents a) Source #
exceptExcept :: forall v a. Lens' (Except v a) [Whitespace] Source #
exceptBody :: forall v a. Lens' (Except v a) (Suite v a) Source #
try ... finally
data TryFinally v a Source #
MkTryFinally | |
|
Instances
Lenses
tfAnn :: forall v a. Lens' (TryFinally v a) a Source #
tfIndents :: forall v a. Lens' (TryFinally v a) (Indents a) Source #
tfTry :: forall v a. Lens' (TryFinally v a) [Whitespace] Source #
tfBody :: forall v a. Lens' (TryFinally v a) (Suite v a) Source #
tfFinally :: forall v a. Lens' (TryFinally v a) (Finally v a) Source #
finally
MkFinally | |
|
Lenses
finallyIndents :: forall v a. Lens' (Finally v a) (Indents a) Source #
finallyFinally :: forall v a. Lens' (Finally v a) [Whitespace] Source #
with
statements
MkWith | |
|
Lenses
withIndents :: forall v a. Lens' (With v a) (Indents a) Source #
withWith :: forall v a. Lens' (With v a) [Whitespace] Source #
else
MkElse | |
|
Lenses
elseIndents :: forall v a. Lens' (Else v a) (Indents a) Source #
elseElse :: forall v a. Lens' (Else v a) [Whitespace] Source #
Expressions
None
data None (v :: [*]) a Source #
MkNone | |
|
Lenses
noneWhitespace :: forall v a v. Lens (None v a) (None v a) [Whitespace] [Whitespace] Source #
Function calls
MkCall | |
|
Lenses
callFunction :: forall v a. Lens' (Call v a) (Expr v a) Source #
callLeftParen :: forall v a. Lens' (Call v a) [Whitespace] Source #
callArguments :: forall v a. Lens' (Call v a) (Maybe (CommaSep1' (Arg v a))) Source #
callRightParen :: forall v a. Lens' (Call v a) [Whitespace] Source #
Tuples
MkTuple | |
|
Lenses
tupleComma :: forall v a. Lens' (Tuple v a) Comma Source #
Tuple items
Unpacking
data TupleUnpack v a Source #
MkTupleUnpack | |
|
Instances
Eq a => Eq (TupleUnpack v a) Source # | |
Defined in Language.Python.Syntax.Types (==) :: TupleUnpack v a -> TupleUnpack v a -> Bool # (/=) :: TupleUnpack v a -> TupleUnpack v a -> Bool # | |
Show a => Show (TupleUnpack v a) Source # | |
Defined in Language.Python.Syntax.Types showsPrec :: Int -> TupleUnpack v a -> ShowS # show :: TupleUnpack v a -> String # showList :: [TupleUnpack v a] -> ShowS # |
Lenses
tupleUnpackAnn :: forall v a. Lens' (TupleUnpack v a) a Source #
tupleUnpackParens :: forall v a. Lens' (TupleUnpack v a) [([Whitespace], [Whitespace])] Source #
tupleUnpackWhitespace :: forall v a. Lens' (TupleUnpack v a) [Whitespace] Source #
tupleUnpackValue :: forall v a v. Lens (TupleUnpack v a) (TupleUnpack v a) (Expr v a) (Expr v a) Source #
Lists
MkList | |
|
Lenses
listWhitespaceLeft :: forall v a. Lens' (List v a) [Whitespace] Source #
listBody :: forall v a v. Lens (List v a) (List v a) (Maybe (CommaSep1' (ListItem v a))) (Maybe (CommaSep1' (ListItem v a))) Source #
listWhitespaceRight :: forall v a. Lens' (List v a) [Whitespace] Source #
List items
Unpacking
data ListUnpack v a Source #
MkListUnpack | |
|
Instances
Eq a => Eq (ListUnpack v a) Source # | |
Defined in Language.Python.Syntax.Types (==) :: ListUnpack v a -> ListUnpack v a -> Bool # (/=) :: ListUnpack v a -> ListUnpack v a -> Bool # | |
Show a => Show (ListUnpack v a) Source # | |
Defined in Language.Python.Syntax.Types showsPrec :: Int -> ListUnpack v a -> ShowS # show :: ListUnpack v a -> String # showList :: [ListUnpack v a] -> ShowS # |
Lenses
listUnpackAnn :: forall v a. Lens' (ListUnpack v a) a Source #
listUnpackParens :: forall v a. Lens' (ListUnpack v a) [([Whitespace], [Whitespace])] Source #
listUnpackWhitespace :: forall v a. Lens' (ListUnpack v a) [Whitespace] Source #
listUnpackValue :: forall v a v. Lens (ListUnpack v a) (ListUnpack v a) (Expr v a) (Expr v a) Source #