aboutsummaryrefslogtreecommitdiff
path: root/lib/model.ml
diff options
context:
space:
mode:
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