purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.AST.Literals

Description

The core functional representation for literal values.

Synopsis

- data Literal a
  - = NumericLiteral (Either Integer Double)
  - | StringLiteral PSString
  - | CharLiteral Char
  - | BooleanLiteral Bool
  - | ArrayLiteral [a]
  - | ObjectLiteral [(PSString, a)]

# Documentation

data Literal a #

Data type for literal values. Parameterised so it can be used for Exprs and Binders.

Constructors

NumericLiteral (Either Integer Double) | A numeric literal
StringLiteral PSString | A string literal
CharLiteral Char | A character literal
BooleanLiteral Bool | A boolean literal
ArrayLiteral [a] | An array literal
ObjectLiteral [(PSString, a)] | An object literal

#### Instances

Instances details

Functor Literal # |
Instance details Defined in Language.PureScript.AST.Literals Methods fmap :: (a -> b) -> Literal a -> Literal b # (<$) :: a -> Literal b -> Literal a #
NFData a => NFData (Literal a) # |
Instance details Defined in Language.PureScript.AST.Literals Methods rnf :: Literal a -> () #
Generic (Literal a) # |

Instance details

Defined in Language.PureScript.AST.Literals

Associated Types

type Rep (Literal a) |

Instance details

Defined in Language.PureScript.AST.Literals

type Rep (Literal a) = D1 ('MetaData "Literal" "Language.PureScript.AST.Literals" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "NumericLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either Integer Double))) :+: (C1 ('MetaCons "StringLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PSString)) :+: C1 ('MetaCons "CharLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)))) :+: (C1 ('MetaCons "BooleanLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: (C1 ('MetaCons "ArrayLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])) :+: C1 ('MetaCons "ObjectLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PSString, a)])))))

Methods

from :: Literal a -> Rep (Literal a) x #

to :: Rep (Literal a) x -> Literal a #

Show a => Show (Literal a) # |
Instance details Defined in Language.PureScript.AST.Literals Methods showsPrec :: Int -> Literal a -> ShowS # show :: Literal a -> String # showList :: [Literal a] -> ShowS #
Eq a => Eq (Literal a) # |
Instance details Defined in Language.PureScript.AST.Literals Methods (==) :: Literal a -> Literal a -> Bool # (/=) :: Literal a -> Literal a -> Bool #
Ord a => Ord (Literal a) # |
Instance details Defined in Language.PureScript.AST.Literals Methods compare :: Literal a -> Literal a -> Ordering # (<) :: Literal a -> Literal a -> Bool # (<=) :: Literal a -> Literal a -> Bool # (>) :: Literal a -> Literal a -> Bool # (>=) :: Literal a -> Literal a -> Bool # max :: Literal a -> Literal a -> Literal a # min :: Literal a -> Literal a -> Literal a #
type Rep (Literal a) # |

Instance details

Defined in Language.PureScript.AST.Literals

type Rep (Literal a) = D1 ('MetaData "Literal" "Language.PureScript.AST.Literals" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "NumericLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either Integer Double))) :+: (C1 ('MetaCons "StringLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PSString)) :+: C1 ('MetaCons "CharLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)))) :+: (C1 ('MetaCons "BooleanLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :+: (C1 ('MetaCons "ArrayLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])) :+: C1 ('MetaCons "ObjectLiteral" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(PSString, a)])))))