forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLiterals.hs
More file actions
38 lines (36 loc) · 713 Bytes
/
Literals.hs
File metadata and controls
38 lines (36 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- |
-- The core functional representation for literal values.
--
module Language.PureScript.AST.Literals where
import Prelude.Compat
import Language.PureScript.PSString (PSString)
-- |
-- Data type for literal values. Parameterised so it can be used for Exprs and
-- Binders.
--
data Literal a
-- |
-- A numeric literal
--
= NumericLiteral (Either Integer Double)
-- |
-- A string literal
--
| StringLiteral PSString
-- |
-- A character literal
--
| CharLiteral Char
-- |
-- A boolean literal
--
| BooleanLiteral Bool
-- |
-- An array literal
--
| ArrayLiteral [a]
-- |
-- An object literal
--
| ObjectLiteral [(PSString, a)]
deriving (Eq, Ord, Show, Functor)