Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
da11bb13
Commit
da11bb13
authored
Sep 21, 2013
by
Krzysztof Gogolewski
Browse files
Document more stolen syntax (#4196)
parent
96cfb110
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/glasgow_exts.xml
View file @
da11bb13
...
...
@@ -423,7 +423,11 @@ Indeed, the bindings can even be recursive.
import
<literal>
GHC.Prim
</literal>
(see
<xref
linkend=
"primitives"
/>
);
the
<option>
-XMagicHash
</option>
extension
then allows you to
<emphasis>
refer
</emphasis>
to the
<literal>
Int
#
</literal>
that is now in scope.
</para>
that is now in scope. Note that with this option, the meaning of
<literal>
x
#
y = 0
</literal>
is changed: it defines a function
<literal>
x
#
</literal>
taking a single argument
<literal>
y
</literal>
;
to define the operator
<literal>
#
</literal>
, put a space:
<literal>
x
#
y = 0
</literal>
.
</para>
<para>
The
<option>
-XMagicHash
</option>
also enables some new forms of literals (see
<xref
linkend=
"glasgow-unboxed"
/>
):
<itemizedlist>
<listitem><para>
<literal>
'x'
#
</literal>
has type
<literal>
Char
#
</literal></para>
</listitem>
...
...
@@ -2268,13 +2272,30 @@ The following syntax is stolen:
<replaceable>
string
</replaceable><literal>
#
</literal>
,
<replaceable>
integer
</replaceable><literal>
#
</literal>
,
<replaceable>
float
</replaceable><literal>
#
</literal>
,
<replaceable>
float
</replaceable><literal>
##
</literal>
,
<literal>
(
#
</literal>
,
<literal>
#
)
</literal>
<replaceable>
float
</replaceable><literal>
##
</literal>
</term>
<listitem><para>
Stolen by:
<option>
-XMagicHash
</option>
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<literal>
(
#
</literal>
,
<literal>
#
)
</literal>
</term>
<listitem><para>
Stolen by:
<option>
-XUnboxedTuples
</option>
</para></listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>
varid
</replaceable><literal>
!
</literal><replaceable>
varid
</replaceable>
</term>
<listitem><para>
Stolen by:
<option>
-XBangPatterns
</option>
</para></listitem>
</varlistentry>
</variablelist>
</para>
</sect2>
...
...
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