Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
f6d61129
Commit
f6d61129
authored
Jul 31, 2006
by
simonpj@microsoft.com
Browse files
Add notes about unsafeCoerce
parent
7929e422
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/glasgow_exts.xml
View file @
f6d61129
...
...
@@ -6072,7 +6072,7 @@ shortcoming is something that could be fixed, with some kind of pragma.)
</para>
</sect2>
<sect2>
<title>
The
<literal>
inline
</literal>
function
</title>
<sect2>
<title>
The
<literal>
lazy
</literal>
function
</title>
<para>
The
<literal>
lazy
</literal>
function restrains strictness analysis a little:
<programlisting>
...
...
@@ -6097,6 +6097,21 @@ look strict in <literal>y</literal> which would defeat the whole
purpose of
<literal>
par
</literal>
.
</para>
</sect2>
<sect2>
<title>
The
<literal>
unsafeCoerce#
</literal>
function
</title>
<para>
The function
<literal>
unsafeCoerce#
</literal>
allows you to side-step the
typechecker entirely. It has type
<programlisting>
unsafeCoerce# :: a -> b
</programlisting>
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.
</para>
</sect2>
</sect1>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment