Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
--{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.MountedObject
|
||||
where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
data MountedObject
|
||||
= MountedLS Int
|
||||
| MountedProp Int
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON MountedObject where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON MountedObject
|
||||
|
||||
Reference in New Issue
Block a user