Refactor, try to limit dependencies
This commit is contained in:
+12
-13
@@ -1,23 +1,22 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Bounds
|
||||
where
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Bounds where
|
||||
|
||||
import Control.Lens
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data Bounds = Bounds
|
||||
{ _bdMinX :: Float
|
||||
, _bdMaxX :: Float
|
||||
, _bdMinY :: Float
|
||||
, _bdMaxY :: Float
|
||||
{ _bdMinX :: Float
|
||||
, _bdMaxX :: Float
|
||||
, _bdMinY :: Float
|
||||
, _bdMaxY :: Float
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Bounds where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Bounds
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
defaultBounds :: Bounds
|
||||
defaultBounds = Bounds 0 0 0 0
|
||||
|
||||
makeLenses ''Bounds
|
||||
deriveJSON defaultOptions ''Bounds
|
||||
|
||||
Reference in New Issue
Block a user