[commit: ghc] master: Add Monoid instance for FastString (91a6a9c)

git at git.haskell.org git at git.haskell.org
Sat Mar 5 20:15:15 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/91a6a9cb94172a4c2235e6b2f9001df982bed4cc/ghc

>---------------------------------------------------------------

commit 91a6a9cb94172a4c2235e6b2f9001df982bed4cc
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Fri Mar 4 22:48:50 2016 +0100

    Add Monoid instance for FastString


>---------------------------------------------------------------

91a6a9cb94172a4c2235e6b2f9001df982bed4cc
 compiler/utils/FastString.hs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index ea95d84..27bb510 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -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)
 



More information about the ghc-commits mailing list