Re: Avoiding construction of dead dictionaries

2021-08-16 Thread Michael Sperber
On Thu, Aug 12 2021, Simon Peyton Jones wrote: > Repro case is something like > * Here is a source or files > * Compile like this > * Look at the generated Core...observe silly thing happening Tried my best here: https://gitlab.haskell.org/ghc/ghc/-/issues/20237 Any help on this would be

Re: -dinline-check for symbolic names?

2021-08-18 Thread Michael Sperber
On Tue, Aug 10 2021, Simon Peyton Jones wrote: > It's hard to tell what is happening without a repro case. Can you share one? Haven't been able to do that with <10MB of output, I'm afraid ... > You suggested that it might have something to do with using an > operator. Does the same thing

Re: Avoiding construction of dead dictionaries

2021-08-09 Thread Michael Sperber
Thanks for thinking about this one! On Fri, Aug 06 2021, Tom Smeding wrote: > Would it not be unsound for ghc to elide dictionary construction here? > After all, the right-hand side might actually be a bottom > (e.g. undefined) at run-time, in which case the pattern match cannot > succeed

Re: Avoiding construction of dead dictionaries

2021-08-12 Thread Michael Sperber
On Mon, Aug 09 2021, Simon Peyton Jones wrote: > Could you offer a small repro case, with a pointer to evidence that it > matters in practice, and open a ticket? I'll try my best, but I'm unsure how I would generate evidence. Could you give me a hint? Is there any way to see how far

-dinline-check for symbolic names?

2021-08-04 Thread Michael Sperber
I'm trying to figure out why this function from ConCat.AltCat is not getting inlined: (&&&) :: forall k a c d. (MProductCat k, Ok3 k a c d) => (a `k` c) -> (a `k` d) -> (a `k` Prod k c d) f &&& g = (f *** g) . dup <+ okProd @k @a @a <+ okProd @k @c @d {-# INLINE (&&&) #-} So I put

Re: -dinline-check for symbolic names?

2021-08-06 Thread Michael Sperber
On Wed, Aug 04 2021, Carter Schonwald wrote: > I’m not sure about the pragma debugging, but are you using it in point free > style? Cause I’m that case it may not be inclined because it’s not being > fully applied on the left hand side? Good point, but I checked, and it's fully applied. :-( I

Re: -dinline-check for symbolic names?

2021-08-06 Thread Michael Sperber
On Fri, Aug 06 2021, Michael Sperber wrote: > On Wed, Aug 04 2021, Carter Schonwald wrote: > >> I’m not sure about the pragma debugging, but are you using it in point free >> style? Cause I’m that case it may not be inclined because it’s not being >> fully appli

Avoiding construction of dead dictionaries

2021-08-06 Thread Michael Sperber
I have another optimization problem. ConCat includes this definition: (<+) :: Con a => (Con b => r) -> (a |- b) -> r r <+ Entail (Sub Dict) = r The right-hand argument of <+ leads to a dictionary construction that is a proof of a certain property, but the dictionary itself ends up being dead,

How to fool the divergence checker in ghc 9

2023-01-20 Thread Michael Sperber
I'm trying to port Conal Elliott's ConCat plugin from ghc 8 to 9, and the divergence checker foils me. Background: The plugin works by transforming calls to a pseudo-function toCcc' defined like so: -- | Pseudo function to trigger rewriting to TOCCC form. toCcc' :: forall k a b. (a -> b) -> (a

Re: How to fool the divergence checker in ghc 9

2023-01-20 Thread Michael Sperber
On Fri, Jan 20 2023, David Feuer wrote: > I don't know what all that means exactly (especially since GHC's demand > signatures have changed recently in a way I don't understand at all). But > for hiding divergence, one option is to use a module with demand analysis > disabled. Try {-#

Re: How to fool the divergence checker in ghc 9

2023-01-20 Thread Michael Sperber
On Fri, Jan 20 2023, David Feuer wrote: > Actually, getting that arity probably isn't important anyway Try O0. Ah, that worked. Many thanks! -- Regards, Mike ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org