Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Damage.Type where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
data DamageType
|
||||
= PIERCING
|
||||
| BLUNT
|
||||
@@ -16,4 +19,9 @@ data DamageType
|
||||
| PUSHDAM
|
||||
| POISONDAM
|
||||
| ENTERREMENT
|
||||
deriving (Eq,Ord,Show,Read,Enum,Bounded)
|
||||
deriving (Eq,Ord,Show,Read,Enum,Bounded,Generic)
|
||||
instance ToJSON DamageType where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON DamageType
|
||||
instance ToJSONKey DamageType
|
||||
instance FromJSONKey DamageType
|
||||
|
||||
Reference in New Issue
Block a user