.. so that it's easier to combine the values together.

Signed-off-by: Petr Pudlak <[email protected]>
---
 src/Ganeti/ConstantUtils.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Ganeti/ConstantUtils.hs b/src/Ganeti/ConstantUtils.hs
index ace1df7..6a61cf2 100644
--- a/src/Ganeti/ConstantUtils.hs
+++ b/src/Ganeti/ConstantUtils.hs
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 module Ganeti.ConstantUtils where
 
 import Data.Char (ord)
+import Data.Monoid (Monoid(..))
 import Data.Set (Set)
 import qualified Data.Set as Set (difference, fromList, toList, union)
 
@@ -62,6 +63,10 @@ instance PyValue PythonNone where
 newtype FrozenSet a = FrozenSet { unFrozenSet :: Set a }
   deriving (Eq, Ord, Show)
 
+instance (Ord a) => Monoid (FrozenSet a) where
+  mempty = FrozenSet mempty
+  mappend (FrozenSet s) (FrozenSet t) = FrozenSet (mappend s t)
+
 -- | Converts a Haskell 'Set' into a Python 'frozenset'
 --
 -- This instance was supposed to be for 'Set' instead of 'FrozenSet'.
-- 
2.4.3.573.g4eafbef

Reply via email to