summaryrefslogtreecommitdiff
path: root/src/World
diff options
context:
space:
mode:
Diffstat (limited to 'src/World')
-rw-r--r--src/World/Types.hs7
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')