| Safe Haskell | Safe-Inferred |
|---|
Language.PureScript.CodeGen.JS.AST
Description
Data types for the intermediate simplified-Javascript AST
- data UnaryOperator
- = Negate
- | Not
- | BitwiseNot
- | Positive
- | JSNew
- data BinaryOperator
- = Add
- | Subtract
- | Multiply
- | Divide
- | Modulus
- | EqualTo
- | NotEqualTo
- | LessThan
- | LessThanOrEqualTo
- | GreaterThan
- | GreaterThanOrEqualTo
- | And
- | Or
- | BitwiseAnd
- | BitwiseOr
- | BitwiseXor
- | ShiftLeft
- | ShiftRight
- | ZeroFillShiftRight
- data JS
- = JSNumericLiteral (Either Integer Double)
- | JSStringLiteral String
- | JSBooleanLiteral Bool
- | JSUnary UnaryOperator JS
- | JSBinary BinaryOperator JS JS
- | JSArrayLiteral [JS]
- | JSIndexer JS JS
- | JSObjectLiteral [(String, JS)]
- | JSAccessor String JS
- | JSFunction (Maybe String) [String] JS
- | JSApp JS [JS]
- | JSVar String
- | JSConditional JS JS JS
- | JSBlock [JS]
- | JSVariableIntroduction String (Maybe JS)
- | JSAssignment JS JS
- | JSWhile JS JS
- | JSFor String JS JS JS
- | JSForIn String JS JS
- | JSIfElse JS JS (Maybe JS)
- | JSReturn JS
- | JSThrow JS
- | JSTypeOf JS
- | JSInstanceOf JS JS
- | JSLabel String JS
- | JSBreak String
- | JSContinue String
- | JSRaw String
- everywhereOnJS :: (JS -> JS) -> JS -> JS
- everywhereOnJSTopDown :: (JS -> JS) -> JS -> JS
- everythingOnJS :: (r -> r -> r) -> (JS -> r) -> JS -> r
Documentation
data UnaryOperator Source
Built-in unary operators
Constructors
| Negate | Numeric negation |
| Not | Boolean negation |
| BitwiseNot | Bitwise negation |
| Positive | Numeric unary 'plus' |
| JSNew | Constructor |
Instances
| Eq UnaryOperator | |
| Data UnaryOperator | |
| Show UnaryOperator | |
| Typeable UnaryOperator |
data BinaryOperator Source
Built-in binary operators
Constructors
| Add | Numeric addition |
| Subtract | Numeric subtraction |
| Multiply | Numeric multiplication |
| Divide | Numeric division |
| Modulus | Remainder |
| EqualTo | Generic equality test |
| NotEqualTo | Generic inequality test |
| LessThan | Numeric less-than |
| LessThanOrEqualTo | Numeric less-than-or-equal |
| GreaterThan | Numeric greater-than |
| GreaterThanOrEqualTo | Numeric greater-than-or-equal |
| And | Boolean and |
| Or | Boolean or |
| BitwiseAnd | Bitwise and |
| BitwiseOr | Bitwise or |
| BitwiseXor | Bitwise xor |
| ShiftLeft | Bitwise left shift |
| ShiftRight | Bitwise right shift |
| ZeroFillShiftRight | Bitwise right shift with zero-fill |
Instances
| Eq BinaryOperator | |
| Data BinaryOperator | |
| Show BinaryOperator | |
| Typeable BinaryOperator |
Data type for simplified Javascript expressions
Constructors
| JSNumericLiteral (Either Integer Double) | A numeric literal |
| JSStringLiteral String | A string literal |
| JSBooleanLiteral Bool | A boolean literal |
| JSUnary UnaryOperator JS | A unary operator application |
| JSBinary BinaryOperator JS JS | A binary operator application |
| JSArrayLiteral [JS] | An array literal |
| JSIndexer JS JS | An array indexer expression |
| JSObjectLiteral [(String, JS)] | An object literal |
| JSAccessor String JS | An object property accessor expression |
| JSFunction (Maybe String) [String] JS | A function introduction (optional name, arguments, body) |
| JSApp JS [JS] | Function application |
| JSVar String | Variable |
| JSConditional JS JS JS | Conditional expression |
| JSBlock [JS] | A block of expressions in braces |
| JSVariableIntroduction String (Maybe JS) | A variable introduction and optional initialization |
| JSAssignment JS JS | A variable assignment |
| JSWhile JS JS | While loop |
| JSFor String JS JS JS | For loop |
| JSForIn String JS JS | ForIn loop |
| JSIfElse JS JS (Maybe JS) | If-then-else statement |
| JSReturn JS | Return statement |
| JSThrow JS | Throw statement |
| JSTypeOf JS | Type-Of operator |
| JSInstanceOf JS JS | InstanceOf test |
| JSLabel String JS | Labelled statement |
| JSBreak String | Break statement |
| JSContinue String | Continue statement |
| JSRaw String | Raw Javascript (generated when parsing fails for an inline foreign import declaration) |
everythingOnJS :: (r -> r -> r) -> (JS -> r) -> JS -> rSource