Add Monoid instance for FastString
authorBen Gamari <ben@smart-cactus.org>
Fri, 4 Mar 2016 21:48:50 +0000 (22:48 +0100)
committerBen Gamari <ben@smart-cactus.org>
Fri, 4 Mar 2016 23:25:16 +0000 (00:25 +0100)
compiler/utils/FastString.hs

index ea95d84..27bb510 100644 (file)
@@ -192,6 +192,10 @@ instance Ord FastString where
             | otherwise =  y
     compare a b = cmpFS a b
 
+instance Monoid FastString where
+    mempty = nilFS
+    mappend = appendFS
+
 instance Show FastString where
    show fs = show (unpackFS fs)