2BUBV6QXELYZZH5LDQ2LTR5BDQCLP2L5WJ2OPAZKXA2ZGZKUGZMQC stratum :: a -> Strata astratum a = Strata [singleton a]fuse :: Debatable a => Front a -> Front a -> (Front a, Front a, Front a)fuse (Front a) (Front b) = letm = map (flip map b . weigh) am' = transpose ms = map (not . any (== Dominated)) ms' = map (not . any (== Dominates)) m'(f1, t1) = partition snd $ zip a s(f2, t2) = partition snd $ zip b s'in (Front $ map fst (f1 ++ f2), Front $ map fst t1, Front $ map fst t2)
instance Debatable a => Semigroup (Strata a) wherea <> b = mconcat [a,b]instance Debatable a => Monoid (Strata a) wheremempty = Strata []mconcat = Strata . rebuild . transpose . map getStrata whererebuild [] = []rebuild ([] : r) = rebuild rrebuild ([x] : r) = x : rebuild rrebuild ((x : y : s) : r) = let(f, p, q) = fuse x yr' = push p $ push q rin rebuild ((f: s): r')push (Front []) r = rpush q [] = [[q]]push q (s : r) = ((q:s) : r)
getStrata :: Strata a -> [Front a]getStrata (Strata l) = l