Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ganeti.HTools.PeerMap
Description
Module abstracting the peer map implementation.
This is abstracted separately since the speed of peermap updates can be a significant part of the total runtime, and as such changing the implementation should be easy in case it's needed.
Synopsis
Documentation
Arguments
:: (Elem -> Elem -> Elem) | function used to merge the elements |
-> [(Key, Elem)] | source data |
-> PeerMap | results |
Create a PeerMap from an association list, with possible duplicates.
add :: Key -> Elem -> PeerMap -> PeerMap #
Add an element to a peermap, overwriting the previous value.
Find the maximum element.
Since this is a sorted list, we just get the value at the head of the list, or zero for a null list