Commit 089222c9 authored by thomasw's avatar thomasw Committed by Austin Seipp

Rename NamedWildcards flag to NamedWildCards

Summary:
Mind the capital C. As there is already a flag RecordWildCards with a capital
C, we should at least try to be consistent in the spelling of WildCards.

Test Plan: validate

Reviewers: goldfire, simonpj, austin

Reviewed By: simonpj, austin

Subscribers: carter, thomie

Differential Revision: https://phabricator.haskell.org/D584
parent 6eb86a56
......@@ -630,7 +630,7 @@ data ExtensionFlag
| Opt_EmptyCase
| Opt_PatternSynonyms
| Opt_PartialTypeSignatures
| Opt_NamedWildcards
| Opt_NamedWildCards
| Opt_StaticPointers
deriving (Eq, Enum, Show)
......@@ -3107,7 +3107,7 @@ xFlags = [
flagSpec "MultiWayIf" Opt_MultiWayIf,
flagSpec "NPlusKPatterns" Opt_NPlusKPatterns,
flagSpec "NamedFieldPuns" Opt_RecordPuns,
flagSpec "NamedWildcards" Opt_NamedWildcards,
flagSpec "NamedWildCards" Opt_NamedWildCards,
flagSpec "NegativeLiterals" Opt_NegativeLiterals,
flagSpec "NondecreasingIndentation" Opt_NondecreasingIndentation,
flagSpec' "NullaryTypeClasses" Opt_NullaryTypeClasses
......
......@@ -2961,7 +2961,7 @@ hintExplicitForall span = do
]
namedWildcardsEnabled :: P Bool
namedWildcardsEnabled = liftM ((Opt_NamedWildcards `xopt`) . dflags) getPState
namedWildcardsEnabled = liftM ((Opt_NamedWildCards `xopt`) . dflags) getPState
{-
%************************************************************************
......
......@@ -1056,10 +1056,10 @@
<entry><option>-XNoNamedFieldPuns</option></entry>
</row>
<row>
<entry><option>-XNamedWildcards</option></entry>
<entry><option>-XNamedWildCards</option></entry>
<entry>Enable <link linkend="named-wildcards">named wildcards</link>.</entry>
<entry>dynamic</entry>
<entry><option>-XNoNamedWildcards</option></entry>
<entry><option>-XNoNamedWildCards</option></entry>
</row>
<row>
<entry><option>-XNegativeLiterals</option></entry>
......
......@@ -8729,7 +8729,7 @@ Bool</literal> can be simplified away.
<para>
By default, GHC (as the Haskell 2010 standard prescribes) parses identifiers
starting with an underscore in a type as type variables. To treat them as
named wildcards, the <option>-XNamedWildcards</option> flag should be enabled.
named wildcards, the <option>-XNamedWildCards</option> flag should be enabled.
The example below demonstrated the effect.
</para>
......@@ -8739,7 +8739,7 @@ foo _ = False
</programlisting>
<para>
Compiling this program without enabling <option>-XNamedWildcards</option>
Compiling this program without enabling <option>-XNamedWildCards</option>
produces the following error message complaining about the type variable
<literal>_a</literal> no matching the actual type <literal>Bool</literal>.
</para>
......@@ -8755,7 +8755,7 @@ Test.hs:5:9:
</programlisting>
<para>
Compiling this program with <option>-XNamedWildcards</option> enabled produces
Compiling this program with <option>-XNamedWildCards</option> enabled produces
the following error message reporting the inferred type of the named wildcard
<literal>_a</literal>.
</para>
......
......@@ -36,7 +36,7 @@ expectedGhcOnlyExtensions = ["RelaxedLayout",
"DeriveAnyClass",
"PatternSynonyms",
"PartialTypeSignatures",
"NamedWildcards",
"NamedWildCards",
"StaticPointers"]
expectedCabalOnlyExtensions :: [String]
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module Either where
barry :: _a -> (_b _a, _b _)
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module EveryNamed where
every :: (_a -> Bool) -> [_a] -> Bool
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module ExpressionSigNamed where
bar :: _a -> _a
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module GenNamed where
bar :: _a -> _a
......
{-# LANGUAGE PartialTypeSignatures, ScopedTypeVariables, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, ScopedTypeVariables, NamedWildCards #-}
module Meltdown where
import Control.Applicative
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module NamedTyVar where
foo :: (_a, b) -> (a, _b)
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module ScopedNamedWildcards where
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module ScopedNamedWildcardsGood where
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module ShowNamed where
showTwo :: Show _a => _a -> String
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module SomethingShowable where
somethingShowable :: Show _x => _x -> _
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module UncurryNamed where
unc :: (_a -> _b -> _c) -> (_a, _b) -> _c
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards, ScopedTypeVariables, RankNTypes #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards, ScopedTypeVariables, RankNTypes #-}
module WildcardInstantiations where
......
{-# LANGUAGE NamedWildcards #-}
{-# LANGUAGE NamedWildCards #-}
module InstantiatedNamedWildcardsInConstraints where
foo :: (Enum _a, _) => _a -> (String, b)
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module NamedExtraConstraintsWildcard where
foo :: (Eq a, _a) => a -> a
......
{-# LANGUAGE NamedWildcards #-}
{-# LANGUAGE NamedWildCards #-}
module NamedWildcardsEnabled where
foo :: _a -> _b
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
module NamedWildcardsNotInMonotype where
foo :: (Show _a, Eq _c, Eq _b) => _a -> _b -> String
......
{-# LANGUAGE RankNTypes, PartialTypeSignatures, NamedWildcards #-}
{-# LANGUAGE RankNTypes, PartialTypeSignatures, NamedWildCards #-}
module NestedNamedExtraConstraintsWildcard where
foo :: Bool -> (Eq a, _a) => a
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards, ScopedTypeVariables #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards, ScopedTypeVariables #-}
module ScopedNamedWildcardsBad where
......
{-# LANGUAGE NamedWildcards, ScopedTypeVariables #-}
{-# LANGUAGE NamedWildCards, ScopedTypeVariables #-}
module TidyClash2 where
barry :: forall w_. _ -> _ -> w_
......
{-# LANGUAGE PartialTypeSignatures, NamedWildcards, DatatypeContexts #-}
{-# LANGUAGE PartialTypeSignatures, NamedWildCards, DatatypeContexts #-}
module WildcardInADTContext2 where
data (Eq _a) => Foo a = Foo { getFoo :: a }
{-# LANGUAGE NamedWildcards, ScopedTypeVariables, RankNTypes #-}
{-# LANGUAGE NamedWildCards, ScopedTypeVariables, RankNTypes #-}
module WildcardInstantiations where
......
{-# LANGUAGE NamedWildcards, ScopedTypeVariables #-}
{-# LANGUAGE NamedWildCards, ScopedTypeVariables #-}
module WildcardsInPatternAndExprSig where
bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c) = [x, z] :: [_d]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment