diff options
Diffstat (limited to 'ocaml/types.ml')
| -rw-r--r-- | ocaml/types.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ocaml/types.ml b/ocaml/types.ml index 60d3725..badfee3 100644 --- a/ocaml/types.ml +++ b/ocaml/types.ml @@ -7,3 +7,7 @@ type mal_type = | Bool of bool | String of string | Fn of (mal_type list -> mal_type) + +let to_bool x = match x with + | Nil | Bool false -> false + | _ -> true |
