chore: show on ReadPlan and MediaType

This commit is contained in:
steve-chavez
2023-07-05 17:35:54 -05:00
committed by Steve Chavez
parent 7508230760
commit 20b06efabe
7 changed files with 29 additions and 51 deletions
+3 -8
View File
@@ -17,14 +17,6 @@ import Network.HTTP.Types.Header (Header, hContentType)
import Protolude
--
-- $setup
-- Setup for doctests
-- >>> import Text.Pretty.Simple (pPrint)
-- >>> deriving instance Show MTPlanFormat
-- >>> deriving instance Show MTPlanOption
-- >>> deriving instance Show MediaType
-- | Enumeration of currently supported media types
data MediaType
= MTApplicationJSON
@@ -39,6 +31,7 @@ data MediaType
| MTAny
| MTOther ByteString
| MTPlan MediaType MTPlanFormat [MTPlanOption]
deriving Show
instance Eq MediaType where
MTApplicationJSON == MTApplicationJSON = True
MTSingularJSON == MTSingularJSON = True
@@ -56,9 +49,11 @@ instance Eq MediaType where
data MTPlanOption
= PlanAnalyze | PlanVerbose | PlanSettings | PlanBuffers | PlanWAL
deriving (Eq, Show)
data MTPlanFormat
= PlanJSON | PlanText
deriving (Eq, Show)
-- | Convert MediaType to a Content-Type HTTP Header
toContentType :: MediaType -> Header