hpython-0.1: Syntax tree and DSL for Python

Copyright(C) CSIRO 2017-2018
LicenseBSD3
MaintainerIsaac Elliott <isaace71295@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Language.Python.Syntax.Types

Contents

Description

Datatypes for different parts of Python syntax

Synopsis

Parameters

Positional parameters

data PositionalParam v a Source #

Constructors

MkPositionalParam 

Fields

Instances
Eq a => Eq (PositionalParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Show a => Show (PositionalParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Lenses

ppAnn :: forall v a. Lens' (PositionalParam v a) a Source #

ppName :: forall v a. Lens' (PositionalParam v a) (Ident v a) Source #

ppType :: forall v a. Lens' (PositionalParam v a) (Maybe (Colon, Expr v a)) Source #

Starred Parameters

data StarParam v a Source #

Constructors

MkStarParam 

Fields

Instances
Eq a => Eq (StarParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: StarParam v a -> StarParam v a -> Bool #

(/=) :: StarParam v a -> StarParam v a -> Bool #

Show a => Show (StarParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> StarParam v a -> ShowS #

show :: StarParam v a -> String #

showList :: [StarParam v a] -> ShowS #

Lenses

spAnn :: forall v a. Lens' (StarParam v a) a Source #

spWhitespace :: forall v a. Lens' (StarParam v a) [Whitespace] Source #

spName :: forall v a. Lens' (StarParam v a) (Ident v a) Source #

spType :: forall v a. Lens' (StarParam v a) (Maybe (Colon, Expr v a)) Source #

Unnamed Starred Parameters

data UnnamedStarParam (v :: [*]) a Source #

Constructors

MkUnnamedStarParam 

Fields

Instances
Eq a => Eq (UnnamedStarParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Show a => Show (UnnamedStarParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Lenses

uspAnn :: forall v a v a. Lens (UnnamedStarParam v a) (UnnamedStarParam v a) a a Source #

Keyword parameters

data KeywordParam v a Source #

Constructors

MkKeywordParam 

Fields

Instances
Eq a => Eq (KeywordParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: KeywordParam v a -> KeywordParam v a -> Bool #

(/=) :: KeywordParam v a -> KeywordParam v a -> Bool #

Show a => Show (KeywordParam v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Lenses

kpAnn :: forall v a. Lens' (KeywordParam v a) a Source #

kpName :: forall v a. Lens' (KeywordParam v a) (Ident v a) Source #

kpType :: forall v a. Lens' (KeywordParam v a) (Maybe (Colon, Expr 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

data Fundef v a Source #

Instances
HasFundef Fundef Source # 
Instance details

Defined in Language.Python.Optics

Methods

_Fundef :: Prism (Fundef v a) (Fundef [] a) (Fundef v a) (Fundef [] a) Source #

AsyncSyntax Fundef Source # 
Instance details

Defined in Language.Python.DSL

DecoratorsSyntax Fundef Source # 
Instance details

Defined in Language.Python.DSL

ParametersSyntax Fundef Source # 
Instance details

Defined in Language.Python.DSL

Methods

parameters_ :: Functor f => ([Raw Param] -> f [Raw Param]) -> Raw Fundef -> f (Raw Fundef) Source #

parameters :: Lens' (Raw Fundef) (CommaSep (Raw Param)) Source #

BodySyntax Fundef Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw Fundef -> f (Raw Fundef) Source #

body :: Lens' (Raw Fundef) (Raw Suite) Source #

AsLine Fundef Source # 
Instance details

Defined in Language.Python.DSL

Methods

line_ :: Raw Fundef -> Raw Line Source #

Eq a => Eq (Fundef v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Fundef v a -> Fundef v a -> Bool #

(/=) :: Fundef v a -> Fundef v a -> Bool #

Show a => Show (Fundef v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Fundef v a -> ShowS #

show :: Fundef v a -> String #

showList :: [Fundef v a] -> ShowS #

HasIndents (Fundef ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Fundef [] a) (Indents a) Source #

Lenses

fdAnn :: forall v a. Lens' (Fundef v a) a Source #

fdDecorators :: forall v a. Lens' (Fundef v a) [Decorator v a] Source #

fdIndents :: forall v a. Lens' (Fundef v a) (Indents a) Source #

fdAsync :: forall v a. Lens' (Fundef v a) (Maybe (NonEmpty Whitespace)) Source #

fdDefSpaces :: forall v a. Lens' (Fundef v a) (NonEmpty Whitespace) Source #

fdName :: forall v a. Lens' (Fundef v a) (Ident v a) Source #

fdLeftParenSpaces :: forall v a. Lens' (Fundef v a) [Whitespace] Source #

fdParameters :: forall v a. Lens' (Fundef v a) (CommaSep (Param v a)) 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 #

fdBody :: forall v a. Lens' (Fundef v a) (Suite v a) Source #

Class definitions

data ClassDef v a Source #

Instances
HasClassDef ClassDef Source # 
Instance details

Defined in Language.Python.Optics

Methods

_ClassDef :: Prism (ClassDef v a) (ClassDef [] a) (ClassDef v a) (ClassDef [] a) Source #

DecoratorsSyntax ClassDef Source # 
Instance details

Defined in Language.Python.DSL

ArgumentsSyntax ClassDef Source # 
Instance details

Defined in Language.Python.DSL

BodySyntax ClassDef Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw ClassDef -> f (Raw ClassDef) Source #

body :: Lens' (Raw ClassDef) (Raw Suite) Source #

AsLine ClassDef Source # 
Instance details

Defined in Language.Python.DSL

Eq a => Eq (ClassDef v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: ClassDef v a -> ClassDef v a -> Bool #

(/=) :: ClassDef v a -> ClassDef v a -> Bool #

Show a => Show (ClassDef v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> ClassDef v a -> ShowS #

show :: ClassDef v a -> String #

showList :: [ClassDef v a] -> ShowS #

HasIndents (ClassDef ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (ClassDef [] a) (Indents a) Source #

Lenses

cdAnn :: forall v a. Lens' (ClassDef v a) a Source #

cdDecorators :: forall v a. Lens' (ClassDef v a) [Decorator v a] Source #

cdIndents :: forall v a. Lens' (ClassDef v a) (Indents a) Source #

cdClass :: forall v a. Lens' (ClassDef v a) (NonEmpty Whitespace) Source #

cdName :: forall v a. Lens' (ClassDef v a) (Ident v a) Source #

cdArguments :: forall v a. Lens' (ClassDef v a) (Maybe ([Whitespace], Maybe (CommaSep1' (Arg v a)), [Whitespace])) Source #

cdBody :: forall v a. Lens' (ClassDef v a) (Suite v a) Source #

if statements

data If v a Source #

Constructors

MkIf 

Fields

Instances
HasIf If Source # 
Instance details

Defined in Language.Python.Optics

Methods

_If :: Prism (If v a) (If [] a) (If v a) (If [] a) Source #

ElseSyntax If Source # 
Instance details

Defined in Language.Python.DSL

BodySyntax If Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw If -> f (Raw If) Source #

body :: Lens' (Raw If) (Raw Suite) Source #

AsLine If Source # 
Instance details

Defined in Language.Python.DSL

Methods

line_ :: Raw If -> Raw Line Source #

Eq a => Eq (If v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: If v a -> If v a -> Bool #

(/=) :: If v a -> If v a -> Bool #

Show a => Show (If v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> If v a -> ShowS #

show :: If v a -> String #

showList :: [If v a] -> ShowS #

HasIndents (If ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (If [] a) (Indents a) Source #

Lenses

ifAnn :: forall v a. Lens' (If v a) a Source #

ifIndents :: forall v a. Lens' (If v a) (Indents a) Source #

ifIf :: forall v a. Lens' (If v a) [Whitespace] Source #

ifCond :: forall v a. Lens' (If v a) (Expr v a) Source #

ifBody :: forall v a. Lens' (If v a) (Suite v a) Source #

ifElifs :: forall v a. Lens' (If v a) [Elif v a] Source #

ifElse :: forall v a. Lens' (If v a) (Maybe (Else v a)) Source #

elif

data Elif v a Source #

Constructors

MkElif 
Instances
BodySyntax Elif Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw Elif -> f (Raw Elif) Source #

body :: Lens' (Raw Elif) (Raw Suite) Source #

Eq a => Eq (Elif v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Elif v a -> Elif v a -> Bool #

(/=) :: Elif v a -> Elif v a -> Bool #

Show a => Show (Elif v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Elif v a -> ShowS #

show :: Elif v a -> String #

showList :: [Elif v a] -> ShowS #

HasIndents (Elif ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Elif [] a) (Indents a) Source #

Lenses

elifIndents :: forall v a. Lens' (Elif v a) (Indents a) Source #

elifElif :: forall v a. Lens' (Elif v a) [Whitespace] Source #

elifCond :: forall v a. Lens' (Elif v a) (Expr v a) Source #

elifBody :: forall v a. Lens' (Elif v a) (Suite v a) Source #

for statements

data For v a Source #

Instances
HasFor For Source # 
Instance details

Defined in Language.Python.Optics

Methods

_For :: Prism (For v a) (For [] a) (For v a) (For [] a) Source #

AsyncSyntax For Source # 
Instance details

Defined in Language.Python.DSL

Methods

async_ :: Raw For -> Raw For Source #

ElseSyntax For Source # 
Instance details

Defined in Language.Python.DSL

BodySyntax For Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw For -> f (Raw For) Source #

body :: Lens' (Raw For) (Raw Suite) Source #

AsLine For Source # 
Instance details

Defined in Language.Python.DSL

Methods

line_ :: Raw For -> Raw Line Source #

Eq a => Eq (For v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: For v a -> For v a -> Bool #

(/=) :: For v a -> For v a -> Bool #

Show a => Show (For v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> For v a -> ShowS #

show :: For v a -> String #

showList :: [For v a] -> ShowS #

HasIndents (For ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (For [] a) (Indents a) Source #

Lenses

forAnn :: forall v a. Lens' (For v a) a Source #

forIndents :: forall v a. Lens' (For v a) (Indents a) Source #

forAsync :: forall v a. Lens' (For v a) (Maybe (NonEmpty Whitespace)) Source #

forFor :: forall v a. Lens' (For v a) [Whitespace] Source #

forBinder :: forall v a. Lens' (For v a) (Expr v a) Source #

forIn :: forall v a. Lens' (For v a) [Whitespace] Source #

forCollection :: forall v a. Lens' (For v a) (CommaSep1' (Expr v a)) Source #

forBody :: forall v a. Lens' (For v a) (Suite v a) Source #

forElse :: forall v a. Lens' (For v a) (Maybe (Else v a)) Source #

while statements

data While v a Source #

Constructors

MkWhile 
Instances
HasWhile While Source # 
Instance details

Defined in Language.Python.Optics

Methods

_While :: Prism (While v a) (While [] a) (While v a) (While [] a) Source #

ElseSyntax While Source # 
Instance details

Defined in Language.Python.DSL

BodySyntax While Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw While -> f (Raw While) Source #

body :: Lens' (Raw While) (Raw Suite) Source #

AsLine While Source # 
Instance details

Defined in Language.Python.DSL

Methods

line_ :: Raw While -> Raw Line Source #

Eq a => Eq (While v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: While v a -> While v a -> Bool #

(/=) :: While v a -> While v a -> Bool #

Show a => Show (While v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> While v a -> ShowS #

show :: While v a -> String #

showList :: [While v a] -> ShowS #

HasIndents (While ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (While [] a) (Indents a) Source #

Lenses

whileAnn :: forall v a. Lens' (While v a) a Source #

whileIndents :: forall v a. Lens' (While v a) (Indents a) Source #

whileWhile :: forall v a. Lens' (While v a) [Whitespace] Source #

whileCond :: forall v a. Lens' (While v a) (Expr v a) Source #

whileBody :: forall v a. Lens' (While v a) (Suite v a) Source #

whileElse :: forall v a. Lens' (While v a) (Maybe (Else v a)) Source #

try ... except ... else ... finally

data TryExcept v a Source #

Constructors

MkTryExcept 

Fields

Instances
HasTryExcept TryExcept Source # 
Instance details

Defined in Language.Python.Optics

Methods

_TryExcept :: Prism (TryExcept v a) (TryExcept [] a) (TryExcept v a) (TryExcept [] a) Source #

ElseSyntax TryExcept Source # 
Instance details

Defined in Language.Python.DSL

BodySyntax TryExcept Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw TryExcept -> f (Raw TryExcept) Source #

body :: Lens' (Raw TryExcept) (Raw Suite) Source #

AsLine TryExcept Source # 
Instance details

Defined in Language.Python.DSL

ExceptSyntax (Raw TryExcept) Source #
except_ :: [Raw Line] -> Raw TryExcept -> Raw TryExcept
exceptAs_ :: AsExceptAs => Raw e -> [Raw Line] -> Raw TryExcept -> Raw TryExcept
(someTryStatement :: Raw TryExcept) &
  except_ [line_ pass_]
(someTryStatement :: Raw TryExcept) &
  exceptAs_ (var_ "Exception" `as_` id_ "b") [line_ pass_]
Instance details

Defined in Language.Python.DSL

FinallySyntax (Raw TryExcept) TryExcept Source #
>>> tryE_ [line_ pass_] & finally_ [line_ pass_]
try:
    pass
finally:
    pass
>>> tryF_ [line_ pass_] [line_ (a .+= 1)] & finally_ [line_ pass_]
try:
    pass
finally:
    pass
>>> tryF_ [line_ pass_] & finally_ [line_ pass_]
try:
    pass
finally:
    pass
Instance details

Defined in Language.Python.DSL

Eq a => Eq (TryExcept v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: TryExcept v a -> TryExcept v a -> Bool #

(/=) :: TryExcept v a -> TryExcept v a -> Bool #

Show a => Show (TryExcept v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> TryExcept v a -> ShowS #

show :: TryExcept v a -> String #

showList :: [TryExcept v a] -> ShowS #

HasIndents (TryExcept ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (TryExcept [] a) (Indents a) Source #

Lenses

teAnn :: forall v a. Lens' (TryExcept v a) a Source #

teIndents :: forall v a. Lens' (TryExcept v a) (Indents a) Source #

teTry :: forall v a. Lens' (TryExcept v a) [Whitespace] Source #

teBody :: forall v a. Lens' (TryExcept v a) (Suite v a) Source #

teExcepts :: forall v a. Lens' (TryExcept v a) (NonEmpty (Except v a)) Source #

teElse :: forall v a. Lens' (TryExcept v a) (Maybe (Else v a)) Source #

teFinally :: forall v a. Lens' (TryExcept v a) (Maybe (Finally v a)) Source #

except

data Except v a Source #

Instances
Eq a => Eq (Except v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Except v a -> Except v a -> Bool #

(/=) :: Except v a -> Except v a -> Bool #

Show a => Show (Except v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Except v a -> ShowS #

show :: Except v a -> String #

showList :: [Except v a] -> ShowS #

HasIndents (Except ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Except [] a) (Indents a) Source #

Lenses

exceptIndents :: forall v a. Lens' (Except v a) (Indents a) Source #

exceptExcept :: forall v a. Lens' (Except v a) [Whitespace] Source #

exceptExceptAs :: forall v a. Lens' (Except v a) (Maybe (ExceptAs v a)) Source #

exceptBody :: forall v a. Lens' (Except v a) (Suite v a) Source #

try ... finally

data TryFinally v a Source #

Constructors

MkTryFinally 

Fields

Instances
HasTryFinally TryFinally Source # 
Instance details

Defined in Language.Python.Optics

Methods

_TryFinally :: Prism (TryFinally v a) (TryFinally [] a) (TryFinally v a) (TryFinally [] a) Source #

BodySyntax TryFinally Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw TryFinally -> f (Raw TryFinally) Source #

body :: Lens' (Raw TryFinally) (Raw Suite) Source #

AsLine TryFinally Source # 
Instance details

Defined in Language.Python.DSL

ExceptSyntax (Raw TryFinally) Source #
except_ :: [Raw Line] -> Raw TryFinally -> Raw TryExcept
exceptAs_ :: AsExceptAs => Raw e -> [Raw Line] -> Raw TryFinally -> Raw TryExcept
(someTryStatement :: Raw TryFinally) &
  except_ [line_ pass_]
(someTryStatement :: Raw TryFinally) &
  exceptAs_ (var_ "Exception" `as_` id_ "b") [line_ pass_]
Instance details

Defined in Language.Python.DSL

FinallySyntax (Raw TryFinally) TryFinally Source # 
Instance details

Defined in Language.Python.DSL

Eq a => Eq (TryFinally v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: TryFinally v a -> TryFinally v a -> Bool #

(/=) :: TryFinally v a -> TryFinally v a -> Bool #

Show a => Show (TryFinally v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> TryFinally v a -> ShowS #

show :: TryFinally v a -> String #

showList :: [TryFinally v a] -> ShowS #

HasIndents (TryFinally ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (TryFinally [] a) (Indents a) Source #

(a ~ [Raw Line], b ~ Raw TryFinally) => FinallySyntax (a -> b) TryFinally Source # 
Instance details

Defined in Language.Python.DSL

Methods

finally_ :: [Raw Line] -> (a -> b) -> Raw TryFinally Source #

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

data Finally v a Source #

Instances
Eq a => Eq (Finally v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Finally v a -> Finally v a -> Bool #

(/=) :: Finally v a -> Finally v a -> Bool #

Show a => Show (Finally v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Finally v a -> ShowS #

show :: Finally v a -> String #

showList :: [Finally v a] -> ShowS #

HasIndents (Finally ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Finally [] a) (Indents a) Source #

Lenses

finallyIndents :: forall v a. Lens' (Finally v a) (Indents a) Source #

finallyFinally :: forall v a. Lens' (Finally v a) [Whitespace] Source #

finallyBody :: forall v a v. Lens (Finally v a) (Finally v a) (Suite v a) (Suite v a) Source #

with statements

data With v a Source #

Instances
HasWith With Source # 
Instance details

Defined in Language.Python.Optics

Methods

_With :: Prism (With v a) (With [] a) (With v a) (With [] a) Source #

AsyncSyntax With Source # 
Instance details

Defined in Language.Python.DSL

Methods

async_ :: Raw With -> Raw With Source #

BodySyntax With Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw With -> f (Raw With) Source #

body :: Lens' (Raw With) (Raw Suite) Source #

AsLine With Source # 
Instance details

Defined in Language.Python.DSL

Methods

line_ :: Raw With -> Raw Line Source #

Eq a => Eq (With v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: With v a -> With v a -> Bool #

(/=) :: With v a -> With v a -> Bool #

Show a => Show (With v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> With v a -> ShowS #

show :: With v a -> String #

showList :: [With v a] -> ShowS #

HasIndents (With ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (With [] a) (Indents a) Source #

Lenses

withAnn :: forall v a. Lens' (With v a) a Source #

withIndents :: forall v a. Lens' (With v a) (Indents a) Source #

withAsync :: forall v a. Lens' (With v a) (Maybe (NonEmpty Whitespace)) Source #

withWith :: forall v a. Lens' (With v a) [Whitespace] Source #

withItems :: forall v a. Lens' (With v a) (CommaSep1 (WithItem v a)) Source #

withBody :: forall v a. Lens' (With v a) (Suite v a) Source #

else

data Else v a Source #

Constructors

MkElse 
Instances
BodySyntax Else Source # 
Instance details

Defined in Language.Python.DSL

Methods

body_ :: Functor f => ([Raw Line] -> f [Raw Line]) -> Raw Else -> f (Raw Else) Source #

body :: Lens' (Raw Else) (Raw Suite) Source #

Eq a => Eq (Else v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Else v a -> Else v a -> Bool #

(/=) :: Else v a -> Else v a -> Bool #

Show a => Show (Else v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Else v a -> ShowS #

show :: Else v a -> String #

showList :: [Else v a] -> ShowS #

HasIndents (Else ([] :: [Type]) a) a Source # 
Instance details

Defined in Language.Python.Optics.Indents

Methods

_Indents :: Traversal' (Else [] a) (Indents a) Source #

Lenses

elseIndents :: forall v a. Lens' (Else v a) (Indents a) Source #

elseElse :: forall v a. Lens' (Else v a) [Whitespace] Source #

elseBody :: forall v a v. Lens (Else v a) (Else v a) (Suite v a) (Suite v a) Source #

Expressions

None

data None (v :: [*]) a Source #

Constructors

MkNone 
Instances
Eq a => Eq (None v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: None v a -> None v a -> Bool #

(/=) :: None v a -> None v a -> Bool #

Show a => Show (None v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> None v a -> ShowS #

show :: None v a -> String #

showList :: [None v a] -> ShowS #

Lenses

noneAnn :: forall v a v a. Lens (None v a) (None v a) a a Source #

noneWhitespace :: forall v a v. Lens (None v a) (None v a) [Whitespace] [Whitespace] Source #

Function calls

data Call v a Source #

Instances
ArgumentsSyntax Call Source # 
Instance details

Defined in Language.Python.DSL

Eq a => Eq (Call v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Call v a -> Call v a -> Bool #

(/=) :: Call v a -> Call v a -> Bool #

Show a => Show (Call v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Call v a -> ShowS #

show :: Call v a -> String #

showList :: [Call v a] -> ShowS #

Lenses

callAnn :: forall v a. Lens' (Call v a) a Source #

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

data Tuple v a Source #

Constructors

MkTuple 
Instances
Eq a => Eq (Tuple v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: Tuple v a -> Tuple v a -> Bool #

(/=) :: Tuple v a -> Tuple v a -> Bool #

Show a => Show (Tuple v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> Tuple v a -> ShowS #

show :: Tuple v a -> String #

showList :: [Tuple v a] -> ShowS #

Lenses

tupleAnn :: forall v a. Lens' (Tuple v a) a Source #

tupleHead :: forall v a. Lens' (Tuple v a) (TupleItem v a) Source #

tupleComma :: forall v a. Lens' (Tuple v a) Comma Source #

tupleTail :: forall v a. Lens' (Tuple v a) (Maybe (CommaSep1' (TupleItem v a))) Source #

Tuple items

Unpacking

data TupleUnpack v a Source #

Instances
Eq a => Eq (TupleUnpack v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: TupleUnpack v a -> TupleUnpack v a -> Bool #

(/=) :: TupleUnpack v a -> TupleUnpack v a -> Bool #

Show a => Show (TupleUnpack v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

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

data List v a Source #

Instances
Eq a => Eq (List v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: List v a -> List v a -> Bool #

(/=) :: List v a -> List v a -> Bool #

Show a => Show (List v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

showsPrec :: Int -> List v a -> ShowS #

show :: List v a -> String #

showList :: [List v a] -> ShowS #

Lenses

listAnn :: forall v a. Lens' (List v a) a Source #

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 #

Instances
Eq a => Eq (ListUnpack v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

(==) :: ListUnpack v a -> ListUnpack v a -> Bool #

(/=) :: ListUnpack v a -> ListUnpack v a -> Bool #

Show a => Show (ListUnpack v a) Source # 
Instance details

Defined in Language.Python.Syntax.Types

Methods

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 #