Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
jberryman
GHC
Commits
77a4675a
Commit
77a4675a
authored
Jun 05, 2009
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the docs on how you bind unlifted types in let/where clauses
parent
8bf9fcc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
docs/users_guide/glasgow_exts.xml
docs/users_guide/glasgow_exts.xml
+5
-7
No files found.
docs/users_guide/glasgow_exts.xml
View file @
77a4675a
...
...
@@ -210,22 +210,20 @@ in a <emphasis>top-level</emphasis> binding.
in a
<emphasis>
recursive
</emphasis>
binding.
</para></listitem>
<listitem><para>
You may bind unboxed variables in a (non-recursive,
non-top-level) pattern binding, but any such variable causes the entire
pattern-match
to become strict. For example:
non-top-level) pattern binding, but you must make any such pattern-match
strict. For example, rather than:
<programlisting>
data Foo = Foo Int Int#
f x = let (Foo a b, w) = ..rhs.. in ..body..
</programlisting>
Since
<literal>
b
</literal>
has type
<literal>
Int#
</literal>
, the entire pattern
match
is strict, and the program behaves as if you had written
you must write:
<programlisting>
data Foo = Foo Int Int#
f x =
case ..rhs.. of {
(Foo a b, w)
->
..body..
}
f x =
let !
(Foo a b, w)
= ..rhs.. in
..body..
</programlisting>
since
<literal>
b
</literal>
has type
<literal>
Int#
</literal>
.
</para>
</listitem>
</itemizedlist>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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