diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-12-01 17:38:23 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-01 18:45:23 +0100 |
commit | 1e041b7382b6aa329e4ad9625439f811e0f27232 (patch) | |
tree | 91f4418553a1e6df072f56f43b5697d40c985b5f /testsuite/tests/gadt/rw.stderr | |
parent | b432e2f39c095d8acbb0cfcc63bd08436c7a3e49 (diff) | |
download | haskell-1e041b7382b6aa329e4ad9625439f811e0f27232.tar.gz |
Refactor treatment of wildcards
This patch began as a modest refactoring of HsType and friends, to
clarify and tidy up exactly where quantification takes place in types.
Although initially driven by making the implementation of wildcards more
tidy (and fixing a number of bugs), I gradually got drawn into a pretty
big process, which I've been doing on and off for quite a long time.
There is one compiler performance regression as a result of all
this, in perf/compiler/T3064. I still need to look into that.
* The principal driving change is described in Note [HsType binders]
in HsType. Well worth reading!
* Those data type changes drive almost everything else. In particular
we now statically know where
(a) implicit quantification only (LHsSigType),
e.g. in instance declaratios and SPECIALISE signatures
(b) implicit quantification and wildcards (LHsSigWcType)
can appear, e.g. in function type signatures
* As part of this change, HsForAllTy is (a) simplified (no wildcards)
and (b) split into HsForAllTy and HsQualTy. The two contructors
appear when and only when the correponding user-level construct
appears. Again see Note [HsType binders].
HsExplicitFlag disappears altogether.
* Other simplifications
- ExprWithTySig no longer needs an ExprWithTySigOut variant
- TypeSig no longer needs a PostRn name [name] field
for wildcards
- PatSynSig records a LHsSigType rather than the decomposed
pieces
- The mysterious 'GenericSig' is now 'ClassOpSig'
* Renamed LHsTyVarBndrs to LHsQTyVars
* There are some uninteresting knock-on changes in Haddock,
because of the HsSyn changes
I also did a bunch of loosely-related changes:
* We already had type synonyms CoercionN/CoercionR for nominal and
representational coercions. I've added similar treatment for
TcCoercionN/TcCoercionR
mkWpCastN/mkWpCastN
All just type synonyms but jolly useful.
* I record-ised ForeignImport and ForeignExport
* I improved the (poor) fix to Trac #10896, by making
TcTyClsDecls.checkValidTyCl recover from errors, but adding a
harmless, abstract TyCon to the envt if so.
* I did some significant refactoring in RnEnv.lookupSubBndrOcc,
for reasons that I have (embarrassingly) now totally forgotten.
It had to do with something to do with import and export
Updates haddock submodule.
Diffstat (limited to 'testsuite/tests/gadt/rw.stderr')
-rw-r--r-- | testsuite/tests/gadt/rw.stderr | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/testsuite/tests/gadt/rw.stderr b/testsuite/tests/gadt/rw.stderr index dcd3e10397..39529a7003 100644 --- a/testsuite/tests/gadt/rw.stderr +++ b/testsuite/tests/gadt/rw.stderr @@ -1,27 +1,29 @@ -rw.hs:14:47: - Couldn't match expected type ‘a’ with actual type ‘Int’ +rw.hs:14:47: error: + • Couldn't match expected type ‘a’ with actual type ‘Int’ ‘a’ is a rigid type variable bound by - the type signature for: writeInt :: T a -> IORef a -> IO () - at rw.hs:12:12 - In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’ - In the expression: writeIORef ref (1 :: Int) - In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int) - Relevant bindings include - ref :: IORef a (bound at rw.hs:13:12) - v :: T a (bound at rw.hs:13:10) - writeInt :: T a -> IORef a -> IO () (bound at rw.hs:13:1) + the type signature for: + writeInt :: forall a. T a -> IORef a -> IO () + at rw.hs:12:12 + • In the second argument of ‘writeIORef’, namely ‘(1 :: Int)’ + In the expression: writeIORef ref (1 :: Int) + In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int) + • Relevant bindings include + ref :: IORef a (bound at rw.hs:13:12) + v :: T a (bound at rw.hs:13:10) + writeInt :: T a -> IORef a -> IO () (bound at rw.hs:13:1) -rw.hs:19:51: - Couldn't match type ‘a’ with ‘Bool’ +rw.hs:19:51: error: + • Couldn't match type ‘a’ with ‘Bool’ ‘a’ is a rigid type variable bound by - the type signature for: readBool :: T a -> IORef a -> IO () - at rw.hs:16:12 - Expected type: a -> Bool - Actual type: Bool -> Bool - In the second argument of ‘(.)’, namely ‘not’ - In the second argument of ‘(>>=)’, namely ‘(print . not)’ - Relevant bindings include - ref :: IORef a (bound at rw.hs:17:12) - v :: T a (bound at rw.hs:17:10) - readBool :: T a -> IORef a -> IO () (bound at rw.hs:17:1) + the type signature for: + readBool :: forall a. T a -> IORef a -> IO () + at rw.hs:16:12 + Expected type: a -> Bool + Actual type: Bool -> Bool + • In the second argument of ‘(.)’, namely ‘not’ + In the second argument of ‘(>>=)’, namely ‘(print . not)’ + • Relevant bindings include + ref :: IORef a (bound at rw.hs:17:12) + v :: T a (bound at rw.hs:17:10) + readBool :: T a -> IORef a -> IO () (bound at rw.hs:17:1) |