Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/491c3593fdbd44e54ce817bcd0ac2de3b1139ab9

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

commit 491c3593fdbd44e54ce817bcd0ac2de3b1139ab9
Author: Simon Peyton Jones <[email protected]>
Date:   Fri Feb 17 14:02:48 2012 +0000

    Eta expand unsafeCoerce and add a pointer to the Note

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

 Unsafe/Coerce.hs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Unsafe/Coerce.hs b/Unsafe/Coerce.hs
index 72f35b2..50f52ed 100644
--- a/Unsafe/Coerce.hs
+++ b/Unsafe/Coerce.hs
@@ -34,7 +34,10 @@ module Unsafe.Coerce (unsafeCoerce) where
 #if defined(__GLASGOW_HASKELL__)
 import GHC.Prim (unsafeCoerce#)
 unsafeCoerce :: a -> b
-unsafeCoerce = unsafeCoerce#
+unsafeCoerce x = unsafeCoerce# x
+  -- See Note [Unsafe coerce magic] in basicTypes/MkId
+  -- NB: Do not eta-reduce this definition, else the type checker 
+  -- give usafeCoerce the same (dangerous) type as unsafeCoerce#
 #endif
 
 #if defined(__NHC__)



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to