0 | module Control.Monad.Coop.Sync
2 | import Data.SortedMap
9 | record Sync (0 t : k) where
15 | (==) = (==) `on` unSy
19 | compare = compare `on` unSy
22 | newUniqueSync : SortedMap (Sync sk) whatever -> Sync sk
23 | newUniqueSync syncs = Sy $
case unSy . fst <$> leftMost syncs of
26 | Just Z => maybe Z (S . unSy . fst) $
rightMost syncs