Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Eta expand unsafeCoerce and add a pointer to the Note

  • Loading branch information...
1 parent c78232d commit 491c3593fdbd44e54ce817bcd0ac2de3b1139ab9 @simonpj simonpj committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 Unsafe/Coerce.hs
5 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#
#if defined(__NHC__)

0 comments on commit 491c359

Please sign in to comment.
Something went wrong with that request. Please try again.