Open jyp opened 5 years ago
Thanks. Do you have a complete example I can try out? Is your example as polymorphic as it looks here, including in the target category?
This is literally the first example I tried to test the system, I was not trying to do anything useful. Here is the whole program:
{-# OPTIONS_GHC -fplugin=ConCat.Plugin #-}
{-# OPTIONS_GHC -fplugin-opt=ConCat.Plugin:trace #-}
import ConCat.AltCat
import ConCat.Rebox
import ConCat.Category
import ConCat.Syntactic (render)
main :: IO ()
main = putStrLn $ render (toCcc (\f g x -> f (g (x))))
Thanks. Where is comp
defined, and how are you compiling?
I had pasted the wrong version and fixed it in a ninja edit. Essentially comp
is function composition. See github for the corrected full program. Concat version is github from the day of the report. ghc is 8.4.4. Other packages come from nixos 18.03.
Thanks. I'm seeing the behavior you described. I generally compile monomorphic type-specializations of polymorphic functions. In this case, it looks like the plugin isn't finding a suitable transformation, so it's inlining and hoping for the best, which is certainly the wrong choice here.
The following call does not terminate:
When enabling the trace, one sees that the generated term gets larger and larger.