Copyright | (C) CSIRO 2017-2019 |
---|---|
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) (Ann 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 :: Ann a
- _spWhitespace :: [Whitespace]
- _spName :: Ident v a
- _spType :: Maybe (Colon, Expr v a)
- spAnn :: forall v a. Lens' (StarParam v a) (Ann 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 :: Ann a
- _uspWhitespace :: [Whitespace]
- uspAnn :: forall v a v a. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) (Ann a) (Ann 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) (Ann 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 :: Ann 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) (Ann 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 :: Ann 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) (Ann 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) (Ann 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 :: Ann 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) (Ann 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 :: Ann 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) (Ann 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 :: Ann 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) (Ann 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 :: Ann a
- _tfIndents :: Indents a
- _tfTry :: [Whitespace]
- _tfBody :: Suite v a
- _tfFinally :: Finally v a
- tfAnn :: forall v a. Lens' (TryFinally v a) (Ann 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 :: Ann 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) (Ann 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 :: Ann a
- _noneWhitespace :: [Whitespace]
- noneAnn :: forall v a v a. Lens (None v a) (None v a) (Ann a) (Ann a)
- noneWhitespace :: forall v a v. Lens (None v a) (None v a) [Whitespace] [Whitespace]
- data Call v a = MkCall {
- _callAnn :: Ann a
- _callFunction :: Expr v a
- _callLeftParen :: [Whitespace]
- _callArguments :: Maybe (CommaSep1' (Arg v a))
- _callRightParen :: [Whitespace]
- callAnn :: forall v a. Lens' (Call v a) (Ann 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 :: Ann a
- _tupleHead :: TupleItem v a
- _tupleComma :: Comma
- _tupleTail :: Maybe (CommaSep1' (TupleItem v a))
- tupleAnn :: forall v a. Lens' (Tuple v a) (Ann 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 :: Ann a
- _tupleUnpackParens :: [([Whitespace], [Whitespace])]
- _tupleUnpackWhitespace :: [Whitespace]
- _tupleUnpackValue :: Expr v a
- tupleUnpackAnn :: forall v a. Lens' (TupleUnpack v a) (Ann 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 :: Ann a
- _listWhitespaceLeft :: [Whitespace]
- _listBody :: Maybe (CommaSep1' (ListItem v a))
- _listWhitespaceRight :: [Whitespace]
- listAnn :: forall v a. Lens' (List v a) (Ann 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 :: Ann a
- _listUnpackParens :: [([Whitespace], [Whitespace])]
- _listUnpackWhitespace :: [Whitespace]
- _listUnpackValue :: Expr v a
- listUnpackAnn :: forall v a. Lens' (ListUnpack v a) (Ann 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
Lenses
Starred Parameters
MkStarParam | |
|
Instances
Lenses
spWhitespace :: forall v a. Lens' (StarParam v a) [Whitespace] Source #
Unnamed Starred Parameters
data UnnamedStarParam (v :: [*]) a Source #
MkUnnamedStarParam | |
|
Instances
Lenses
uspAnn :: forall v a v a. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) (Ann a) (Ann 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
Lenses
kpEquals :: forall v a. Lens' (KeywordParam v a) [Whitespace] Source #
Compound statements
Function definitions
MkFundef | |
|
Instances
Lenses
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 | |
|
Instances
Lenses
cdArguments :: forall v a. Lens' (ClassDef v a) (Maybe ([Whitespace], Maybe (CommaSep1' (Arg v a)), [Whitespace])) Source #
if
statements
Instances
Lenses
elif
MkElif | |
|
Instances
Lenses
for
statements
MkFor | |
|
Instances
Lenses
forCollection :: forall v a. Lens' (For v a) (CommaSep1' (Expr v a)) Source #
while
statements
MkWhile | |
|
Instances
Lenses
whileWhile :: forall v a. Lens' (While v a) [Whitespace] Source #
try ... except ... else ... finally
MkTryExcept | |
|
Instances
Lenses
except
MkExcept | |
|
Instances
Lenses
exceptExcept :: forall v a. Lens' (Except v a) [Whitespace] Source #
try ... finally
data TryFinally v a Source #
MkTryFinally | |
|
Instances
Lenses
tfTry :: forall v a. Lens' (TryFinally v a) [Whitespace] Source #
finally
MkFinally | |
|
Instances
Lenses
finallyFinally :: forall v a. Lens' (Finally v a) [Whitespace] Source #
with
statements
MkWith | |
|
Instances
Lenses
else
MkElse | |
|
Instances
Lenses
Expressions
None
data None (v :: [*]) a Source #
MkNone | |
|
Instances
Functor (None v) Source # | |
Foldable (None v) Source # | |
Defined in Language.Python.Syntax.Types fold :: Monoid m => None v m -> m # foldMap :: Monoid m => (a -> m) -> None v a -> m # foldr :: (a -> b -> b) -> b -> None v a -> b # foldr' :: (a -> b -> b) -> b -> None v a -> b # foldl :: (b -> a -> b) -> b -> None v a -> b # foldl' :: (b -> a -> b) -> b -> None v a -> b # foldr1 :: (a -> a -> a) -> None v a -> a # foldl1 :: (a -> a -> a) -> None v a -> a # elem :: Eq a => a -> None v a -> Bool # maximum :: Ord a => None v a -> a # minimum :: Ord a => None v a -> a # | |
Traversable (None v) Source # | |
HasAnn (None v) Source # | |
Eq a => Eq (None v a) Source # | |
Show a => Show (None v a) Source # | |
Generic (None v a) Source # | |
type Rep (None v a) Source # | |
Defined in Language.Python.Syntax.Types type Rep (None v a) = D1 (MetaData "None" "Language.Python.Syntax.Types" "hpython-0.3-inplace" False) (C1 (MetaCons "MkNone" PrefixI True) (S1 (MetaSel (Just "_noneAnn") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Ann a)) :*: S1 (MetaSel (Just "_noneWhitespace") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Whitespace]))) |
Lenses
noneWhitespace :: forall v a v. Lens (None v a) (None v a) [Whitespace] [Whitespace] Source #
Function calls
MkCall | |
|
Instances
Lenses
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 | |
|
Instances
Lenses
Tuple items
Unpacking
data TupleUnpack v a Source #
MkTupleUnpack | |
|
Instances
Lenses
tupleUnpackAnn :: forall v a. Lens' (TupleUnpack v a) (Ann 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 | |
|
Instances
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
Lenses
listUnpackAnn :: forall v a. Lens' (ListUnpack v a) (Ann 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 #