Open poscat0x04 opened 4 years ago
@poscat0x04, I'm not completely convinced the gains provided are worth the implementation effort, breakage / loss of backwards compatibility, adoption hindrance, ease-of type inference. The tangible gains are essentially the removal of a few characters of boilerplate. It's also possible to use TypeApplications
with Proxy
in the current implementation to save a few characters. Besides aesthetics, what gains does this really provide that doesn't come at the aforementioned costs? The gains must offset all the aforementioned costs in my opinion, otherwise we risk some form of regression.
api1 = serve (Proxy :: Proxy API) handlers -- old
api2 = serve (Proxy @ API) handlers -- current
api3 = serve @API handlers -- proposed
Well I don't think backward compatibility is much of a issue since
serve'
that uses TypeApplications
and deprecate serve
and eventually replace serve
with serve'
@poscat0x04 what tangible benefits does this provide besides boilerplate reduction of a few characters? This change requires modifying every instance of every interpretation for every package. Also, symbolVal
and natVal
still use Proxy
.
I feel like the answer is no, but I'll ask anyway:
Do TypeApplications
have any advantage in compiled time resource usage over Proxy
? My uneducated guess is no because TypeApplications
might be implemented by desugaring to Proxy
.
For contact, I came here after my work code base encountered issues with this compile performance issue: https://github.com/haskell-servant/servant/issues/986
I feel like the answer is no, but I'll ask anyway:
Do
TypeApplications
have any advantage in compiled time resource usage overProxy
? My uneducated guess is no becauseTypeApplications
might be implemented by desugaring toProxy
.For contact, I came here after my work code base encountered issues with this compile performance issue: #986
It looks like the answer is actually yes... though I'd want to test to be totally sure.
https://gitlab.haskell.org/ghc/ghc/-/issues/18902#note_324353
I found out type applications are basically implemented in core and were exposed upward, so this isn't so shocking with that information.
It seems possible this could help servant compile times.
390 there was a proposal 4 years ago on removing Proxy but was rejected . I think the extension TypeApplications is stable enough now so can we reconsider the proposal?