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
Alex D
GHC
Commits
20b98f35
Commit
20b98f35
authored
Feb 25, 2013
by
ian@well-typed.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change how unboxed tuples are lexed; fixes #7627
(# is now always a lexeme, even if followed by a symbol.
parent
890f4657
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
compiler/parser/Lexer.x
compiler/parser/Lexer.x
+1
-1
docs/users_guide/glasgow_exts.xml
docs/users_guide/glasgow_exts.xml
+8
-0
No files found.
compiler/parser/Lexer.x
View file @
20b98f35
...
...
@@ -339,7 +339,7 @@ $tab+ { warn Opt_WarnTabs (text "Tab character") }
}
<0> {
"(#" / { ifExtension unboxedTuplesEnabled
`alexAndPred` notFollowedBySymbol
}
"(#" / { ifExtension unboxedTuplesEnabled }
{ token IToubxparen }
"#)" / { ifExtension unboxedTuplesEnabled }
{ token ITcubxparen }
...
...
docs/users_guide/glasgow_exts.xml
View file @
20b98f35
...
...
@@ -224,6 +224,14 @@ type (primitive or non-primitive). The type of an unboxed tuple looks
the same.
</para>
<para>
Note that when unboxed tuples are enabled,
<literal>
(#
</literal>
is a single lexeme, so for example when using
operators like
<literal>
#
</literal>
and
<literal>
#-
</literal>
you need
to write
<literal>
( # )
</literal>
and
<literal>
( #- )
</literal>
rather than
<literal>
(#)
</literal>
and
<literal>
(#-)
</literal>
.
</para>
<para>
Unboxed tuples are used for functions that need to return multiple
values, but they avoid the heap allocation normally associated with
...
...
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