futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.CodeGen.Backends.GenericPython.AST

# Documentation

data PyExp Source #

Constructors

Integer Integer |
Bool Bool |
Float Double |
String Text |
RawStringLiteral Text |
Var String |
BinOp String PyExp PyExp |
UnOp String PyExp |
Cond PyExp PyExp PyExp |
Index PyExp PyIdx |
Call PyExp [PyArg] |
Tuple [PyExp] |
List [PyExp] |
Field PyExp String |
Dict [(PyExp, PyExp)] |
Lambda String PyExp |
None |

#### Instances

Instances details

Show PyExp Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyExp -> ShowS Source # show :: PyExp -> String Source # showList :: [PyExp] -> ShowS Source #
Eq PyExp Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyExp -> PyExp -> Bool Source # (/=) :: PyExp -> PyExp -> Bool Source #
Pretty PyExp Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyExp -> Doc ann Source # prettyList :: [PyExp] -> Doc ann Source #

data PyIdx Source #

Constructors

IdxRange PyExp PyExp |
IdxExp PyExp |

#### Instances

Instances details

Show PyIdx Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyIdx -> ShowS Source # show :: PyIdx -> String Source # showList :: [PyIdx] -> ShowS Source #
Eq PyIdx Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyIdx -> PyIdx -> Bool Source # (/=) :: PyIdx -> PyIdx -> Bool Source #
Pretty PyIdx Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyIdx -> Doc ann Source # prettyList :: [PyIdx] -> Doc ann Source #

data PyArg Source #

Constructors

ArgKeyword String PyExp |
Arg PyExp |

#### Instances

Instances details

Show PyArg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyArg -> ShowS Source # show :: PyArg -> String Source # showList :: [PyArg] -> ShowS Source #
Eq PyArg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyArg -> PyArg -> Bool Source # (/=) :: PyArg -> PyArg -> Bool Source #
Pretty PyArg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyArg -> Doc ann Source # prettyList :: [PyArg] -> Doc ann Source #

data PyStmt Source #

Constructors

If PyExp [PyStmt] [PyStmt] |
Try [PyStmt] [PyExcept] |
While PyExp [PyStmt] |
For String PyExp [PyStmt] |
With PyExp [PyStmt] |
Assign PyExp PyExp |
AssignOp String PyExp PyExp |
Comment String [PyStmt] |
Assert PyExp PyExp |
Raise PyExp |
Exp PyExp |
Return PyExp |
Pass |
Import String (Maybe String) |
FunDef PyFunDef |
ClassDef PyClassDef |
Escape Text |

#### Instances

Instances details

Show PyStmt Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyStmt -> ShowS Source # show :: PyStmt -> String Source # showList :: [PyStmt] -> ShowS Source #
Eq PyStmt Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyStmt -> PyStmt -> Bool Source # (/=) :: PyStmt -> PyStmt -> Bool Source #
Pretty PyStmt Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyStmt -> Doc ann Source # prettyList :: [PyStmt] -> Doc ann Source #
MonadWriter [PyStmt] (CompilerM op s) Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython Methods writer :: (a, [PyStmt]) -> CompilerM op s a Source # tell :: [PyStmt] -> CompilerM op s () Source # listen :: CompilerM op s a -> CompilerM op s (a, [PyStmt]) Source # pass :: CompilerM op s (a, [PyStmt] -> [PyStmt]) -> CompilerM op s a Source #

module Language.Futhark.Core

newtype PyProg Source #

Constructors

PyProg [PyStmt] |

#### Instances

Instances details

Show PyProg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyProg -> ShowS Source # show :: PyProg -> String Source # showList :: [PyProg] -> ShowS Source #
Eq PyProg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyProg -> PyProg -> Bool Source # (/=) :: PyProg -> PyProg -> Bool Source #
Pretty PyProg Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyProg -> Doc ann Source # prettyList :: [PyProg] -> Doc ann Source #

data PyExcept Source #

Constructors

Catch PyExp [PyStmt] |

#### Instances

Instances details

Show PyExcept Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyExcept -> ShowS Source # show :: PyExcept -> String Source # showList :: [PyExcept] -> ShowS Source #
Eq PyExcept Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyExcept -> PyExcept -> Bool Source # (/=) :: PyExcept -> PyExcept -> Bool Source #
Pretty PyExcept Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyExcept -> Doc ann Source # prettyList :: [PyExcept] -> Doc ann Source #

data PyFunDef Source #

Constructors

Def String [String] [PyStmt] |

#### Instances

Instances details

Show PyFunDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyFunDef -> ShowS Source # show :: PyFunDef -> String Source # showList :: [PyFunDef] -> ShowS Source #
Eq PyFunDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyFunDef -> PyFunDef -> Bool Source # (/=) :: PyFunDef -> PyFunDef -> Bool Source #
Pretty PyFunDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyFunDef -> Doc ann Source # prettyList :: [PyFunDef] -> Doc ann Source #

data PyClassDef Source #

Constructors

Class String [PyStmt] |

#### Instances

Instances details

Show PyClassDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods showsPrec :: Int -> PyClassDef -> ShowS Source # show :: PyClassDef -> String Source # showList :: [PyClassDef] -> ShowS Source #
Eq PyClassDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods (==) :: PyClassDef -> PyClassDef -> Bool Source # (/=) :: PyClassDef -> PyClassDef -> Bool Source #
Pretty PyClassDef Source # |
Instance details Defined in Futhark.CodeGen.Backends.GenericPython.AST Methods pretty :: PyClassDef -> Doc ann Source # prettyList :: [PyClassDef] -> Doc ann Source #