<div dir="ltr">Forwarding to haskell-infrastructure.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Simon Peyton Jones</b> <span dir="ltr"><<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>></span><br>
Date: Mon, Jun 16, 2014 at 8:59 AM<br>Subject: RE: Regression in the typechecker in GHC 7.8.2<br>To: "<a href="mailto:oleg@okmij.org">oleg@okmij.org</a>" <<a href="mailto:oleg@okmij.org">oleg@okmij.org</a>>, "<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>" <<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a>><br>
<br><br>Copying ghc-devs.  Oleg says:<br>
<br>
|         Sorry for reporting a problem via e-mail. It seems track no<br>
| longer accepts anonymous (guest) submissions. When I tried to register<br>
| the account I was told that my submission is a spam. The tracker is<br>
| really well protected.<br>
<br>
Can anyone help him? I'll open a ticket.<br>
<br>
Simon<br>
<br>
| -----Original Message-----<br>
| From: <a href="mailto:oleg@okmij.org">oleg@okmij.org</a> [mailto:<a href="mailto:oleg@okmij.org">oleg@okmij.org</a>]<br>
| Sent: 16 June 2014 11:46<br>
| To: Simon Peyton Jones<br>
| Subject: Regression in the typechecker in GHC 7.8.2<br>
|<br>
|<br>
| Hello!<br>
|<br>
|         Sorry for reporting a problem via e-mail. It seems track no<br>
| longer accepts anonymous (guest) submissions. When I tried to register<br>
| the account I was told that my submission is a spam. The tracker is<br>
| really well protected.<br>
|<br>
| Here is the problem: what used to type check in GHC 7.4.1 (and I think<br>
| in 7.6.2, although I no longer have access to that version) fails in GHC<br>
| 7.8.2.<br>
|<br>
| The following program type-checks with GHC 7.4.1 and GHC 7.8.2:<br>
|<br>
| {-# LANGUAGE RankNTypes #-}<br>
| {-# LANGUAGE TypeFamilies #-}<br>
|<br>
| module T where<br>
|<br>
| foo :: (forall f g. (Functor f) => f a -> f b) -> [a] -> [b]<br>
| -- foo :: (forall f g. (Functor f, g ~ f) => g a -> g b) -> [a] -> [b]<br>
| foo tr x = tr x<br>
|<br>
| t = foo (fmap not) [True]<br>
|<br>
| The following code (which differs only in the signature of foo)<br>
|<br>
| {-# LANGUAGE RankNTypes #-}<br>
| {-# LANGUAGE TypeFamilies #-}<br>
|<br>
| module T where<br>
|<br>
| -- foo :: (forall f g. (Functor f) => f a -> f b) -> [a] -> [b] foo ::<br>
| (forall f g. (Functor f, g ~ f) => g a -> g b) -> [a] -> [b] foo tr x =<br>
| tr x<br>
|<br>
| t = foo (fmap not) [True]<br>
|<br>
|<br>
| type-checks with 7.4.1 but not with 7.8.2. The latter reports the error<br>
|<br>
|     Couldn't match type `b' with `Bool'<br>
|       `b' is untouchable<br>
|         inside the constraints (Functor f, g ~ f)<br>
|         bound by a type expected by the context:<br>
|                    (Functor f, g ~ f) => g Bool -> g b<br>
|         at /tmp/t.hs:12:5-25<br>
|       `b' is a rigid type variable bound by<br>
|           the inferred type of t :: [b] at /tmp/t.hs:12:1<br>
|     Expected type: Bool -> b<br>
|       Actual type: Bool -> Bool<br>
|     Relevant bindings include t :: [b] (bound at /tmp/t.hs:12:1)<br>
|     In the first argument of `fmap', namely `not'<br>
|     In the first argument of `foo', namely `(fmap not)'<br>
|<br>
| Giving t the type signature [Bool] fixes the problem. Alas, I come<br>
| across the similar untouchable error in situations where giving the type<br>
| signature is quite difficult (in local bindings, with quite large<br>
| types).<br>
|<br>
|         Sorry again for the off-line report,<br>
|         Oleg<br>
<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
</div><br></div>