Hi all,

I discovered today that GHC never specializes functions with implicit 
parameters. This is not that surprising—I wouldn’t expect GHC to specialize the 
implicit parameters themselves—but it’s unfortunate because it means a single 
implicit parameter somewhere can transitively destroy specialization that would 
otherwise be very helpful.

Is there any obstacle to specializing these functions’ other dictionaries and 
leaving the implicit parameters alone? That is, if I have a function

    foo :: (?foo :: Bool, Show a) => a -> String

could GHC specialize `foo @Int` to

    foo :: (?foo :: Bool) => Int -> String

treating the implicit parameter little differently from an ordinary function 
argument?

As far as I can tell, there isn’t any real obstacle to doing this, so unless 
I’m missing something, I might give it a try myself. I just wanted to make sure 
I wasn’t missing anything before diving in.

Thanks,
Alexis
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to