diff options
Diffstat (limited to 'lib/models/snowflake.ml')
| -rw-r--r-- | lib/models/snowflake.ml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/models/snowflake.ml b/lib/models/snowflake.ml new file mode 100644 index 0000000..ed80b62 --- /dev/null +++ b/lib/models/snowflake.ml @@ -0,0 +1,16 @@ +type t = { + id: int; + as_string: string; +} + +let to_int t = t.id +let to_string t = t.as_string + +let from_int i = { + id = i; + as_string = string_of_int i; +} +let from_string s = { + id = int_of_string s; + as_string = s; +}
\ No newline at end of file |