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