about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-06-13T14·25-0400
committergrfn <grfn@gws.fyi>2021-06-14T13·04+0000
commit5b0649d2a8d618805a4df4cc6afc09cefef4fc1f (patch)
tree016dc5ef1593ef41f0af91f0aa704cae34efd440
parentefbb135cfc0511ffcd350def9e9e5efcfc7e887c (diff)
feat(xanthous): BangPattern all fields in Raws r/2658
This is generally just good practice for foundational data-types like
these

Change-Id: I88c5b6b73dad6665cf25837b8d6a9e0ea66f2b0b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3204
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
-rw-r--r--users/grfn/xanthous/src/Xanthous/Entities/RawTypes.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Entities/RawTypes.hs b/users/grfn/xanthous/src/Xanthous/Entities/RawTypes.hs
index 30039662f0..d280136ae8 100644
--- a/users/grfn/xanthous/src/Xanthous/Entities/RawTypes.hs
+++ b/users/grfn/xanthous/src/Xanthous/Entities/RawTypes.hs
@@ -70,8 +70,8 @@ hostile = friendly . involuted not
 --------------------------------------------------------------------------------
 
 data EdibleItem = EdibleItem
-  { _hitpointsHealed :: Int
-  , _eatMessage :: Maybe Message
+  { _hitpointsHealed :: !Int
+  , _eatMessage      :: !(Maybe Message)
   }
   deriving stock (Show, Eq, Ord, Generic)
   deriving anyclass (NFData, CoArbitrary, Function)
@@ -96,12 +96,12 @@ makeFieldsNoPrefix ''WieldableItem
 --------------------------------------------------------------------------------
 
 data ItemType = ItemType
-  { _name            :: Text
-  , _description     :: Text
-  , _longDescription :: Text
-  , _char            :: EntityChar
-  , _edible          :: Maybe EdibleItem
-  , _wieldable       :: Maybe WieldableItem
+  { _name            :: !Text
+  , _description     :: !Text
+  , _longDescription :: !Text
+  , _char            :: !EntityChar
+  , _edible          :: !(Maybe EdibleItem)
+  , _wieldable       :: !(Maybe WieldableItem)
   }
   deriving stock (Show, Eq, Ord, Generic)
   deriving anyclass (NFData, CoArbitrary, Function)
@@ -122,8 +122,8 @@ isWieldable = has $ wieldable . _Just
 --------------------------------------------------------------------------------
 
 data EntityRaw
-  = Creature CreatureType
-  | Item ItemType
+  = Creature !CreatureType
+  | Item !ItemType
   deriving stock (Show, Eq, Generic)
   deriving anyclass (NFData)
   deriving Arbitrary via GenericArbitrary EntityRaw