From: simonpj@microsoft.com Date: Mon, 31 Jul 2006 08:09:22 +0000 (+0000) Subject: Add notes about unsafeCoerce X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=f6d61129f955dd92f96aa6fccbcc12193703c6e9 Add notes about unsafeCoerce --- diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 7a918a8..f803f6d 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -6072,7 +6072,7 @@ shortcoming is something that could be fixed, with some kind of pragma.) - The <literal>inline</literal> function + The <literal>lazy</literal> function The lazy function restrains strictness analysis a little: @@ -6097,6 +6097,21 @@ look strict in y which would defeat the whole purpose of par. + + The <literal>unsafeCoerce#</literal> function + +The function unsafeCoerce# allows you to side-step the +typechecker entirely. It has type + + unsafeCoerce# :: a -> b + +That is, it allows you to coerce any type into any other type. If you use this +function, you had better get it right, otherwise segmentation faults await. +It is generally used when you want to write a program that you know is +well-typed, but where Haskell's type system is not expressive enough to prove +that it is well typed. + +