Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
7217f562
Commit
7217f562
authored
Dec 01, 2010
by
Ian Lynagh
Browse files
Remove NewQualifiedOperators
The extension was rejected by Haskell', and deprecated in 7.0.
parent
6dceb65b
Changes
4
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
7217f562
...
...
@@ -357,7 +357,6 @@ data ExtensionFlag
|
Opt_ImpredicativeTypes
|
Opt_TypeOperators
|
Opt_PackageImports
|
Opt_NewQualifiedOperators
|
Opt_ExplicitForAll
|
Opt_AlternativeLayoutRule
|
Opt_AlternativeLayoutRuleTransitional
...
...
@@ -1627,9 +1626,7 @@ xFlags = [
(
"OverlappingInstances"
,
Opt_OverlappingInstances
,
nop
),
(
"UndecidableInstances"
,
Opt_UndecidableInstances
,
nop
),
(
"IncoherentInstances"
,
Opt_IncoherentInstances
,
nop
),
(
"PackageImports"
,
Opt_PackageImports
,
nop
),
(
"NewQualifiedOperators"
,
Opt_NewQualifiedOperators
,
\
_
->
deprecate
"The new qualified operator syntax was rejected by Haskell'"
)
(
"PackageImports"
,
Opt_PackageImports
,
nop
)
]
defaultFlags
::
[
DynFlag
]
...
...
compiler/parser/Lexer.x
View file @
7217f562
...
...
@@ -369,10 +369,8 @@ $tab+ { warn Opt_WarnTabs (text "Warning: Tab character") }
-- ToDo: - move `var` and (sym) into lexical syntax?
-- - remove backquote from $special?
<0> {
@qual @varsym / { ifExtension oldQualOps } { idtoken qvarsym }
@qual @consym / { ifExtension oldQualOps } { idtoken qconsym }
@qual \( @varsym \) / { ifExtension newQualOps } { idtoken prefixqvarsym }
@qual \( @consym \) / { ifExtension newQualOps } { idtoken prefixqconsym }
@qual @varsym { idtoken qvarsym }
@qual @consym { idtoken qconsym }
@varsym { varsym }
@consym { consym }
}
...
...
@@ -1770,8 +1768,6 @@ inRulePragBit :: Int
inRulePragBit = 19
rawTokenStreamBit :: Int
rawTokenStreamBit = 20 -- producing a token stream with all comments included
newQualOpsBit :: Int
newQualOpsBit = 21 -- Haskell' qualified operator syntax, e.g. Prelude.(+)
recBit :: Int
recBit = 22 -- rec
alternativeLayoutRuleBit :: Int
...
...
@@ -1817,10 +1813,6 @@ qqEnabled flags = testBit flags qqBit
-- inRulePrag flags = testBit flags inRulePragBit
rawTokenStreamEnabled :: Int -> Bool
rawTokenStreamEnabled flags = testBit flags rawTokenStreamBit
newQualOps :: Int -> Bool
newQualOps flags = testBit flags newQualOpsBit
oldQualOps :: Int -> Bool
oldQualOps flags = not (newQualOps flags)
alternativeLayoutRule :: Int -> Bool
alternativeLayoutRule flags = testBit flags alternativeLayoutRuleBit
relaxedLayout :: Int -> Bool
...
...
@@ -1878,7 +1870,6 @@ mkPState flags buf loc =
.|. datatypeContextsBit `setBitIf` xopt Opt_DatatypeContexts flags
.|. transformComprehensionsBit `setBitIf` xopt Opt_TransformListComp flags
.|. rawTokenStreamBit `setBitIf` dopt Opt_KeepRawTokenStream flags
.|. newQualOpsBit `setBitIf` xopt Opt_NewQualifiedOperators flags
.|. alternativeLayoutRuleBit `setBitIf` xopt Opt_AlternativeLayoutRule flags
.|. relaxedLayoutBit `setBitIf` xopt Opt_RelaxedLayout flags
.|. nondecreasingIndentationBit `setBitIf` xopt Opt_NondecreasingIndentation flags
...
...
docs/users_guide/flags.xml
View file @
7217f562
...
...
@@ -831,13 +831,6 @@
<entry>
dynamic
</entry>
<entry><option>
-XNoMagicHash
</option></entry>
</row>
<row>
<entry><option>
-XNewQualifiedOperators
</option></entry>
<entry>
Enable
<link
linkend=
"new-qualified-operators"
>
new
qualified operator syntax
</link></entry>
<entry>
dynamic
</entry>
<entry><option>
-XNoNewQualifiedOperators
</option></entry>
</row>
<row>
<entry><option>
-XExplicitForALl
</option></entry>
<entry>
Enable
<link
linkend=
"explicit-foralls"
>
explicit universal quantification
</link>
.
...
...
docs/users_guide/glasgow_exts.xml
View file @
7217f562
...
...
@@ -450,43 +450,6 @@ Indeed, the bindings can even be recursive.
</para>
</sect2>
<sect2
id=
"new-qualified-operators"
>
<title>
New qualified operator syntax
</title>
<para>
A new syntax for referencing qualified operators is
planned to be introduced by Haskell', and is enabled in GHC
with
the
<option>
-XNewQualifiedOperators
</option><indexterm><primary><option>
-XNewQualifiedOperators
</option></primary></indexterm>
option. In the new syntax, the prefix form of a qualified
operator is
written
<literal><replaceable>
module
</replaceable>
.(
<replaceable>
symbol
</replaceable>
)
</literal>
(without NewQualifiedOperators this would
be
<literal>
(
<replaceable>
module
</replaceable>
.
<replaceable>
symbol
</replaceable>
)
</literal>
),
and the infix form is
written
<literal>
`
<replaceable>
module
</replaceable>
.(
<replaceable>
symbol
</replaceable>
)`
</literal>
(without NewQualifiedOperators this would
be
<literal>
`
<replaceable>
module
</replaceable>
.
<replaceable>
symbol
</replaceable>
`
</literal>
.
For example:
<programlisting>
add x y = Prelude.(+) x y
subtract y = (`Prelude.(-)` y)
</programlisting>
The new form of qualified operators is intended to regularise
the syntax by eliminating odd cases
like
<literal>
Prelude..
</literal>
. For example,
when
<literal>
NewQualifiedOperators
</literal>
is on, it is possible to
write the enumerated sequence
<literal>
[Monday..]
</literal>
without spaces, whereas without NewQualifiedOperators this would be a
reference to the operator
‘
<literal>
.
</literal>
‘
from module
<literal>
Monday
</literal>
.
</para>
<para>
When
<option>
-XNewQualifiedOperators
</option>
is on, the old
syntax for qualified operators is not accepted, so this
option may cause existing code to break.
</para>
</sect2>
<!-- ====================== HIERARCHICAL MODULES ======================= -->
...
...
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