0 | module Data.Mime.Apache.Model
 1 |
 2 | public export
 3 | data MainType
 4 |   = Application
 5 |   | Audio
 6 |   | Chemical
 7 |   | Font
 8 |   | Image
 9 |   | Message
10 |   | Model
11 |   | Multipart
12 |   | Text
13 |   | Video
14 |   | XConference
15 |
16 | export
17 | implementation Show MainType where
18 |   show Application = "application"
19 |   show Audio       = "audio"
20 |   show Chemical    = "chemical"
21 |   show Font        = "font"
22 |   show Image       = "image"
23 |   show Message     = "message"
24 |   show Model       = "model"
25 |   show Multipart   = "multipart"
26 |   show Text        = "text"
27 |   show Video       = "video"
28 |   show XConference = "x-conference"
29 |
30 | export
31 | implementation Eq MainType where
32 |   (==) Application Application = True
33 |   (==) Audio Audio = True
34 |   (==) Chemical Chemical = True
35 |   (==) Font Font = True
36 |   (==) Image Image = True
37 |   (==) Message Message = True
38 |   (==) Model Model = True
39 |   (==) Multipart Multipart = True
40 |   (==) Text Text = True
41 |   (==) Video Video = True
42 |   (==) XConference XConference = True
43 |   (==) _ _ = False
44 |
45 | public export
46 | record Mime where
47 |   constructor MkMime
48 |   mainType : MainType
49 |   subType : String
50 |   extensions : List String
51 |
52 | export
53 | implementation Show Mime where
54 |   show mime = "\{show mime.mainType}/\{mime.subType}"
55 |
56 | export
57 | implementation Eq Mime where
58 |   (==) a b = a.mainType == b.mainType
59 |           && a.subType == b.subType
60 |           && a.extensions == b.extensions
61 |
62 |