22 lines
549 B
Plaintext
22 lines
549 B
Plaintext
module App.Type.MaintenanceSubject where
|
|
|
|
import Data.Codec.Argonaut as CA
|
|
import Data.Maybe (Maybe(..))
|
|
|
|
data MaintenanceSubject
|
|
= Verbosity
|
|
|
|
-- | Codec for just encoding a single value of type `MaintenanceSubject`
|
|
codec :: CA.JsonCodec MaintenanceSubject
|
|
codec =
|
|
CA.prismaticCodec "MaintenanceSubject" from to CA.string
|
|
where
|
|
from :: String -> Maybe MaintenanceSubject
|
|
from = case _ of
|
|
"verbosity" -> Just Verbosity
|
|
_ -> Nothing
|
|
|
|
to :: MaintenanceSubject -> String
|
|
to = case _ of
|
|
Verbosity -> "verbosity"
|