diff options
author | sanine <sanine.not@pm.me> | 2023-12-04 11:55:55 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-12-04 11:55:55 -0600 |
commit | 749df3069669787d2c0a57fb9b9ad66a3605da19 (patch) | |
tree | e703670de4b88f6f5ef96d9621a6e151de58da32 /src/World | |
parent | 1a3814b5ead29e1bbfb2ccfa56b2b2bb76c71994 (diff) |
implement Combinable for Proposal
Diffstat (limited to 'src/World')
-rw-r--r-- | src/World/Types.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/World/Types.hs b/src/World/Types.hs index cf66dd9..e9be991 100644 --- a/src/World/Types.hs +++ b/src/World/Types.hs @@ -101,4 +101,9 @@ instance (Combinable a) => Combinable (AgentPropList a) where combine (AgentPropList xs) (AgentPropList ys) = AgentPropList $ xs ++ ys -newtype Proposal a b c = Proposal ([LatticeProposal a b], [AgentProposal c]) deriving (Show, Eq) +newtype Proposal a b c = Proposal (LatticePropList a b, AgentPropList c) deriving (Show, Eq) + +instance (Combinable a, Combinable b, Combinable c) => Combinable (Proposal a b c) where + identity = Proposal ([], []) + combinable (Proposal (l, a)) (Proposal (l', a')) = (combinable l l') && (combinable a a') + combine (Proposal (l, a)) (Proposal (l', a')) = Proposal (combine l l', combine a a') |