-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstant.fs
24 lines (21 loc) · 969 Bytes
/
Constant.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(*****************************************************************************
** HLinks -- Links-inspired prototype for DB queries mixing sets and bags **
** (C) 2020 The University of Edinburgh **
** ----------------------------------------------------------------------- **
** Constant.fs - Constants **
** **
** author: Wilmer Ricciotti **
*****************************************************************************)
module Constant
type t =
| Bool of bool
| Int of int
| Char of char
| Float of float
| String of string
let string_of_t = function
| Bool b -> b.ToString()
| Int i -> i.ToString()
| Char c -> Printf.sprintf "'%c'" c
| Float f -> f.ToString()
| String s -> Printf.sprintf "\"%s\"" s