diff options
| author | Mishio595 <[email protected]> | 2018-11-24 09:51:03 -0700 |
|---|---|---|
| committer | Mishio595 <[email protected]> | 2018-11-24 09:51:03 -0700 |
| commit | d342c4cf9fe907d2107cd815f9988f8ad147218b (patch) | |
| tree | febb926d6f3e1956346db2d3ee952391b193deb9 /lib/model.ml | |
| parent | Add opam build file (diff) | |
| download | disml-d342c4cf9fe907d2107cd815f9988f8ad147218b.tar.xz disml-d342c4cf9fe907d2107cd815f9988f8ad147218b.zip | |
Major structural changes
Diffstat (limited to 'lib/model.ml')
| -rw-r--r-- | lib/model.ml | 26 |
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 |