<div dir="ltr">I just file a feature request issue:<div><br></div><div><a href="https://gitlab.haskell.org/ghc/ghc/-/issues/20818">https://gitlab.haskell.org/ghc/ghc/-/issues/20818</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 14, 2021 at 12:24 AM David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">It's also really bad for the (new!) LinearTypes extension, since we can't pass x %1-> y where it expects x -> y. We have to eta expand. Ugh.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 13, 2021, 11:14 AM Georgi Lyubenov <<a href="mailto:godzbanebane@gmail.com" target="_blank">godzbanebane@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey!<br><br>I'd say 'yes' seeing as how eta expanding the function works:<br><br>{-# LANGUAGE ImplicitParams #-}<br>{-# LANGUAGE RankNTypes #-}<br><br>module Lib where<br><br>foo :: Int -> ((?self :: Int) => Char) -> Char<br>foo x y = undefined<br><br>bar :: Int -> (Char -> Char)<br>bar x = (let ?self = x in (\u v -> foo u v)) x<br><br>baz :: Int -> (Char -> Char)<br>baz x c = let ?self = x in foo x c<br><br>However, I think it's still worth issuing a ghc bug report for this, as it seems to really hurt implicit param usability in this case<br><br>Cheers,<br><br>Georgi</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 13, 2021 at 5:57 PM ☂Josh Chia (謝任中) <<a href="mailto:joshchia@gmail.com" rel="noreferrer" target="_blank">joshchia@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div>I have the following code that builds successfully with "stack build" under GHC 8.10.7 but fails to build under GHC 9.0.1:<div><br></div><div><a href="https://github.com/jchia/ip-bug" rel="noreferrer" target="_blank">https://github.com/jchia/ip-bug</a><br></div><div><br></div><div>The compiler is switched by commenting/uncommenting the compiler line in stack.yaml.</div><div><br></div><div>GHC 9.0.1 gives me the error I paste at the end. Is this expected (maybe as part of "simplified subsumtion" in <a href="https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#compiler-changes" rel="noreferrer" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#compiler-changes</a>)? If so, how can the code be fixed? If not, is it a compiler bug?</div><div><br></div><div>(This problem came up while using gi-gtk-3.0.38, where implicit params are used a lot).</div><div><br></div><div>Josh</div><div><br></div><div>/home/jchia/gh/ip-bug/src/Lib.hs:10:28: error:<br>    • Couldn't match type ‘(?self::Int) => Char’ with ‘Char’<br>      Expected: Int -> Char -> Char<br>        Actual: Int -> ((?self::Int) => Char) -> Char<br>    • In the expression: foo<br>      In the expression: (let ?self = x in foo) :: Int -> Char -> Char<br>      In the expression:<br>        ((let ?self = x in foo) :: Int -> Char -> Char) x<br>   |<br>10 | bar x = ((let ?self = x in foo) :: Int -> Char -> Char) x<br>   |                            ^^^<br><br>/home/jchia/gh/ip-bug/src/Lib.hs:13:26: error:<br>    • Couldn't match type ‘(?self::Int) => Char’ with ‘Char’<br>      Expected: Char -> Char<br>        Actual: ((?self::Int) => Char) -> Char<br>    • In the expression: foo x<br>      In the expression: let ?self = x in foo x<br>      In an equation for ‘baz’: baz x = let ?self = x in foo x<br>   |<br>13 | baz x = let ?self = x in foo x<br>   |                          ^^^^^<br></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>
</blockquote></div>