Add generic derivations and To/FromJSON instances

This commit is contained in:
2022-07-25 22:49:18 +01:00
parent f5604ef429
commit b8e8413daa
99 changed files with 1406 additions and 517 deletions
+7 -1
View File
@@ -1,7 +1,10 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Gust
where
import GHC.Generics
import Data.Aeson
import Geometry.Data
import Control.Lens
data Gust = Gust
@@ -10,5 +13,8 @@ data Gust = Gust
, _guVel :: Point2
, _guTime :: Int
}
deriving (Eq,Ord,Show,Read)
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Gust where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Gust
makeLenses ''Gust