From 4d5002c4d4b0298f97e117c5f0658e93dee37b43 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Fri, 27 Dec 2024 22:27:19 -0600 Subject: [PATCH] mention that Semigroup EntityMap instance is right-biased --- src/swarm-scenario/Swarm/Game/Entity.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/swarm-scenario/Swarm/Game/Entity.hs b/src/swarm-scenario/Swarm/Game/Entity.hs index 2cb29f199..56dac3c57 100644 --- a/src/swarm-scenario/Swarm/Game/Entity.hs +++ b/src/swarm-scenario/Swarm/Game/Entity.hs @@ -424,15 +424,15 @@ data EntityMap = EntityMap } deriving (Eq, Show, Generic, ToJSON) --- | --- Note that duplicates in a single 'EntityMap' are precluded by the --- 'buildEntityMap' function. --- But it is possible for the latter 'EntityMap' to override --- members of the former with the same name. --- This replacement happens automatically with 'Map', but needs --- to be explicitly handled for the list concatenation --- of 'entityDefinitionOrder' (overridden entries are removed --- from the former 'EntityMap'). +-- | Right-biased union of 'EntityMap's. +-- +-- Note that duplicates in a single 'EntityMap' are precluded by the +-- 'buildEntityMap' function. But it is possible for the right-hand +-- 'EntityMap' to override members of the left-hand with the same name. +-- This replacement happens automatically with 'Map', but needs to +-- be explicitly handled for the list concatenation of +-- 'entityDefinitionOrder' (overridden entries are removed from the +-- former 'EntityMap'). instance Semigroup EntityMap where EntityMap n1 c1 d1 <> EntityMap n2 c2 d2 = EntityMap