From 00cbbab3362578df44851442408a8b91a2a769fa Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Wed, 13 Jan 2016 23:29:17 -0500 Subject: Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 --- testsuite/tests/ado/ado004.stderr | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'testsuite/tests/ado') diff --git a/testsuite/tests/ado/ado004.stderr b/testsuite/tests/ado/ado004.stderr index 6472310ece..6e877617dc 100644 --- a/testsuite/tests/ado/ado004.stderr +++ b/testsuite/tests/ado/ado004.stderr @@ -2,27 +2,27 @@ TYPE SIGNATURES test1 :: forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int test2 :: - forall (f :: * -> *) b a. - (Applicative f, Num a, Num b) => - (a -> f b) -> f b + forall (f :: * -> *) b t. + (Applicative f, Num t, Num b) => + (t -> f b) -> f b test3 :: - forall (m :: * -> *) a a1 a2. - (Num a2, Monad m) => - (a2 -> m a1) -> (a1 -> a1 -> m a) -> m a + forall (m :: * -> *) a t t1. + (Num t, Monad m) => + (t -> m t1) -> (t1 -> t1 -> m a) -> m a test4 :: - forall (m :: * -> *) a a1 a2. - (Num a2, Monad m) => - (a2 -> m a1) -> (a1 -> a1 -> m a) -> m a + forall (m :: * -> *) a a1 t. + (Num t, Monad m) => + (t -> m a1) -> (a1 -> a1 -> m a) -> m a test5 :: - forall (m :: * -> *) a a1 a2. - (Num a2, Monad m) => - (a2 -> m a1) -> (a1 -> a1 -> m a) -> m a + forall (m :: * -> *) a a1 t. + (Num t, Monad m) => + (t -> m a1) -> (a1 -> a1 -> m a) -> m a test6 :: - forall r (m :: * -> *) a. + forall t (m :: * -> *) a. (Num (m a), Monad m) => - (m a -> m (m a)) -> r -> m a + (m a -> m (m a)) -> t -> m a TYPE CONSTRUCTORS COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] -- cgit v1.2.1