Add generic derivations and To/FromJSON instances
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.LinearShockwave where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
data LinearShockwave = LinearShockwave
|
||||
@@ -9,5 +12,8 @@ data LinearShockwave = LinearShockwave
|
||||
, _lwPoints :: [(Point2,Point2)]
|
||||
, _lwTimer :: Int
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON LinearShockwave where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON LinearShockwave
|
||||
makeLenses ''LinearShockwave
|
||||
|
||||
Reference in New Issue
Block a user