summaryrefslogtreecommitdiff
path: root/src/Hint/Data.hs
blob: a5faa442783f438c84eec74339707b23aa2beadc (plain)
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
module Hint.Data where

import Data.Text (Text)
import Data.String
import qualified Data.Text as T

newtype Identifier = Identifier Text
  deriving (Show, Ord, Eq)

instance IsString Identifier where
  fromString = Identifier . T.pack

data Literal
  = Int Int
  | Float Double
  | Boolean Bool
  | String Text
  deriving (Show, Eq)

data Expr
  = Literal Literal
  | If Expr Expr Expr
  | Bind Identifier Expr Expr
  | Ident Identifier
  deriving (Show, Eq)