Cleanup, remove DeriveGeneric language extensions

This commit is contained in:
2025-10-20 12:10:11 +01:00
parent 2056d8ba0e
commit b2fd0543dd
86 changed files with 61 additions and 263 deletions
-1
View File
@@ -1,4 +1,3 @@
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
+24 -16
View File
@@ -1,30 +1,32 @@
{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE EmptyDataDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE EmptyDataDeriving #-}
module Dodge.Data.Item.Location where
import NewInt
import ShortShow
import Dodge.Data.Equipment.Misc
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Equipment.Misc
import NewInt
import ShortShow
-- it would be nice to have these as empty types, but I'm not sure how to get
-- aeson to handle that
data InvInt = InvInt
deriving (Eq,Ord,Show,Read)
deriving (Eq, Ord, Show, Read)
data TurretInt
deriving (Eq,Ord,Show,Read)
deriving (Eq, Ord, Show, Read)
data CrInt = CrInt
deriving (Eq,Ord,Show,Read)
deriving (Eq, Ord, Show, Read)
data ItmInt = ItmInt
deriving (Eq,Ord,Show,Read)
deriving (Eq, Ord, Show, Read)
data ItemLocation
= InInv
= InInv
{ _ilCrID :: Int
, _ilInvID :: NewInt InvInt
, _ilIsRoot :: Bool -- of any item
@@ -33,16 +35,22 @@ data ItemLocation
, _ilEquipSite :: Maybe EquipSite
}
| OnTurret {_ilTuID :: Int}
| OnFloor-- {_ilFlID :: NewInt FloorInt}
| OnFloor -- {_ilFlID :: NewInt FloorInt}
| InVoid
deriving (Eq, Show, Ord, Read) --Generic, Flat)
instance ShortShow ItemLocation where
shortShow (InInv cid invid rootb selb attb esite)
= "InInv:cid" <> shortShow cid <> "invid"<> shortShow (_unNInt invid)
<>"root"<>shortShow rootb<>"sel"<>shortShow selb<>"att"<>shortShow attb<>
shortShow (fmap (SString . show) esite)
shortShow (InInv cid invid rootb selb attb esite) =
"InInv:cid" <> shortShow cid <> "invid" <> shortShow (_unNInt invid)
<> "root"
<> shortShow rootb
<> "sel"
<> shortShow selb
<> "att"
<> shortShow attb
<> shortShow (fmap (SString . show) esite)
shortShow x = show x
-- | OnTurret {_ilTuID :: Int}
-- | OnFloor-- {_ilFlID :: NewInt FloorInt}
-- | InVoid
-2
View File
@@ -1,5 +1,3 @@
{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
-4
View File
@@ -1,5 +1,3 @@
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -27,8 +25,6 @@ data ItemParams
data ShrinkGunStatus = FullSize | Shrunk
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ItemParams
deriveJSON defaultOptions ''ShrinkGunStatus
deriveJSON defaultOptions ''ItemParams
-2
View File
@@ -1,5 +1,3 @@
{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
-2
View File
@@ -1,5 +1,3 @@
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
-2
View File
@@ -1,5 +1,3 @@
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -1,5 +1,3 @@
{-# LANGUAGE DeriveGeneric #-}
--{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}