Dont' eta expand cons when deriving Data
This eta expansion was introduced with the initial commit for Linear types. I believe this isn't needed any longer. My guess is it is an artifact from the initial linear types implementation: data constructors are linear, but they shouldn't need to be eta expanded to be used as higher order functions. I suppose in the early days this wasn't true. For instance, this works now: data T x = T x f = \(x :: forall y. y -> T y) -> x True f T -- ok! T is linear, but can be passed where an unrestricted higher order function is expected. I recall there being some magic around to make this work for data constructors... Since this works, there's no need to eta_expand the data constructors in the derived Data instances. On my machine, this brings the module from #9557 with deriving Data from: * 8s to 6.2s with -O0 * 13s to 9.7s with -O1
parent
6ba79887
No related branches found
No related tags found
Pipeline #102376 failed
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Loading
Please register or sign in to comment