[commit: ghc] master: Add Functor Bag instance (2ca8cf6)
git at git.haskell.org
git at git.haskell.org
Fri Oct 20 02:43:16 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/2ca8cf69c50f6fcae17fdcbbcad16227519e5d02/ghc
>---------------------------------------------------------------
commit 2ca8cf69c50f6fcae17fdcbbcad16227519e5d02
Author: Ben Gamari <ben at smart-cactus.org>
Date: Thu Oct 19 13:25:02 2017 -0400
Add Functor Bag instance
>---------------------------------------------------------------
2ca8cf69c50f6fcae17fdcbbcad16227519e5d02
compiler/utils/Bag.hs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/compiler/utils/Bag.hs b/compiler/utils/Bag.hs
index a027db2..af5caad 100644
--- a/compiler/utils/Bag.hs
+++ b/compiler/utils/Bag.hs
@@ -330,5 +330,8 @@ instance Data a => Data (Bag a) where
dataTypeOf _ = mkNoRepType "Bag"
dataCast1 x = gcast1 x
+instance Functor Bag where
+ fmap = mapBag
+
instance Foldable.Foldable Bag where
foldr = foldrBag
More information about the ghc-commits
mailing list