From d342c4cf9fe907d2107cd815f9988f8ad147218b Mon Sep 17 00:00:00 2001 From: Mishio595 Date: Sat, 24 Nov 2018 09:51:03 -0700 Subject: Major structural changes --- lib/model.ml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/model.ml (limited to 'lib/model.ml') 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 -- cgit v1.2.3