[Haskell-cafe] types calculation
eir at cis.upenn.edu
Wed Nov 11 13:43:07 UTC 2015
Users often introduce so-called "vanilla" type synonyms (with `type` but not `type instance`) to be helpful abbreviations in code. As such, GHC actually takes quite a bit of effort *not* to expand these, so that error messages can report the synonyms instead of their expansions. On the other hand, type /families/ tend to be used for type-level computation. So GHC has decided to try to reduce all type families, while preserving all type synonyms. This is all a bit arbitrary, and it should have no end-user consequence except for error messages and, perhaps, performance.
If you have a complicated type-level program whose compile time is increasing faster than the program size, we'd love to know about it. We (GHC devs) want type-level computation to be efficient!
On Nov 10, 2015, at 3:59 PM, Dmitry Olshansky <olshanskydr at gmail.com> wrote:
> It seems that types without parameters are not reduced in ghc unlike CAFs.
> I.e. if we have
> type T1 a b = ...
> type T2 = T1 Int Int
> than T2 will be calculated on each utilization.
> Is my statement correct? If so, why is it?
> With complicated type-calculation compile time is growing too fast.
> Best regards,
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe