This is great, but does needs some explanatory material, on the Haskell wiki or Trac.
Simon | -----Original Message----- | From: ghc-commits [mailto:ghc-commits-boun...@haskell.org] On Behalf Of | g...@git.haskell.org | Sent: 25 September 2013 05:38 | To: ghc-comm...@haskell.org | Subject: [commit: packages/base] master: Add fmapCoerce to Functor | class. (3da4fd9) | | Repository : ssh://g...@git.haskell.org/base | | On branch : master | Link : | http://ghc.haskell.org/trac/ghc/changeset/3da4fd92e005cb9348ab2852d9268a | d61ae1b347/base | | >--------------------------------------------------------------- | | commit 3da4fd92e005cb9348ab2852d9268ad61ae1b347 | Author: Austin Seipp <aus...@well-typed.com> | Date: Tue Sep 24 23:20:35 2013 -0500 | | Add fmapCoerce to Functor class. | | This allows coercions to work under functors that are not locally | known. | | Authored-by: Edward Kmett <ekm...@gmail.com> | Signed-off-by: Austin Seipp <aus...@well-typed.com> | | | >--------------------------------------------------------------- | | 3da4fd92e005cb9348ab2852d9268ad61ae1b347 | GHC/Base.lhs | 4 +++- | 1 file changed, 3 insertions(+), 1 deletion(-) | | diff --git a/GHC/Base.lhs b/GHC/Base.lhs | index d876202..55172af 100644 | --- a/GHC/Base.lhs | +++ b/GHC/Base.lhs | @@ -105,7 +105,6 @@ module GHC.Base | module GHC.Err -- import it explicitly | ) | where | - | import GHC.Types | import GHC.Classes | import GHC.CString | @@ -186,6 +185,9 @@ class Functor f where | (<$) :: a -> f b -> f a | (<$) = fmap . const | | + fmapCoerce :: Coercible a b => f a -> f b | + fmapCoerce = fmap coerce | + | {- | The 'Monad' class defines the basic operations over a /monad/, | a concept from a branch of mathematics known as /category theory/. | From the perspective of a Haskell programmer, however, it is best to | | _______________________________________________ | ghc-commits mailing list | ghc-comm...@haskell.org | http://www.haskell.org/mailman/listinfo/ghc-commits _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs