aboutsummaryrefslogtreecommitdiff
path: root/lib/model.ml
diff options
context:
space:
mode:
authorMishio595 <[email protected]>2018-11-24 09:51:03 -0700
committerMishio595 <[email protected]>2018-11-24 09:51:03 -0700
commitd342c4cf9fe907d2107cd815f9988f8ad147218b (patch)
treefebb926d6f3e1956346db2d3ee952391b193deb9 /lib/model.ml
parentAdd opam build file (diff)
downloaddisml-d342c4cf9fe907d2107cd815f9988f8ad147218b.tar.xz
disml-d342c4cf9fe907d2107cd815f9988f8ad147218b.zip
Major structural changes
Diffstat (limited to 'lib/model.ml')
-rw-r--r--lib/model.ml26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/model.ml b/lib/model.ml
new file mode 100644
index 0000000..c44a289
--- /dev/null
+++ b/lib/model.ml
@@ -0,0 +1,26 @@
+module Make(M: S.Model) = struct
+ include M
+end
+
+module Message = Make(Message)
+module Guild = Make(Guild)
+module Channel = Make(Channel)
+
+exception Type_Mismatch
+
+type t =
+ | Message of Message.t
+ | Guild of Guild.t
+ | Channel of Channel.t
+
+let to_message = function
+ | Message m -> m
+ | _ -> raise Type_Mismatch
+
+let to_guild = function
+ | Guild m -> m
+ | _ -> raise Type_Mismatch
+
+let to_channel = function
+ | Channel m -> m
+ | _ -> raise Type_Mismatch \ No newline at end of file