<div dir="ltr">Thanks Matthew, <div>Do you think there is any workaround to this issue that we could try?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 21, 2015 at 5:25 PM, Matthew Pickering <span dir="ltr"><<a href="mailto:matthewtpickering@gmail.com" target="_blank">matthewtpickering@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Looks like a definite bug. Filed as #10977<br>
<br>
<a href="https://ghc.haskell.org/trac/ghc/ticket/10997" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/10997</a><br>
<br>
Matt<br>
<div><div class="h5"><br>
On Wed, Oct 21, 2015 at 12:49 PM, Sreenidhi Nair<br>
<<a href="mailto:nair.sreenidhi@gmail.com">nair.sreenidhi@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> We have a pattern synonym as follows<br>
><br>
> type family Showable (a :: k) :: Constraint where<br>
>   Showable (a :: *) = (Show a)<br>
>   Showable a       = ()<br>
><br>
> pattern Just' :: () => (Showable a) => a -> (Maybe a)<br>
> pattern Just' a <- (extractJust -> (True, a)) where<br>
>   Just' a = Just a<br>
><br>
> When we try to use the pattern in a different package, the error was<br>
><br>
>     [1 of 1] Compiling Bar              ( Bar.hs,<br>
> .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Bar.o )<br>
><br>
> /tmp/test/p2/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/lib/x86_64-linux-ghc-7.10.2/p1-0.1.0.0-I5t4il6dN7vIqsT1XgYsM3/Foo.hi<br>
>     Declaration for Just'<br>
>     Pattern synonym Just':<br>
>       Iface type variable out of scope:  k<br>
>     Cannot continue after interface file error<br>
><br>
> The error only occurred when Showable was polykinded and we used synonym in<br>
> a different package . Using the synonym in the same package works fine.<br>
><br>
> This problem did not happen with the following definition of (non polykinded<br>
> ) Showable<br>
><br>
> type family Showable a :: Constraint where<br>
>   Showable a = (Show a)<br>
><br>
> We have attached the sample packages which simulate the exact scenario<br>
> described above.<br>
><br>
> --<br>
> Yours truly,<br>
> Sreenidhi Nair<br>
><br>
</div></div>> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Yours truly,<br>Sreenidhi Nair</div>
</div>