Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Dodge.Data.Item.UseDelay where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Control.Lens
|
||||
data UseDelay -- should just be Delay
|
||||
= NoDelay
|
||||
@@ -18,5 +21,8 @@ data UseDelay -- should just be Delay
|
||||
{_warmTime :: Int
|
||||
,_warmMax :: Int
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON UseDelay where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON UseDelay
|
||||
makeLenses ''UseDelay
|
||||
|
||||
Reference in New Issue
Block a user