[Haskell-cafe] Performance of TL-calculations

Dmitry Olshansky olshanskydr at gmail.com
Fri Apr 13 13:55:09 UTC 2018

Hello, cafe,

The main problem I have when using promising type-level calculation is
compile time.

E.g. I have
> type T = ... :: [Symbol]
Now I don't know the order of Symbols in T. But I want to sort it before
using for some reasons.

I can define
> type T1 = Sort T   -- where Sort is from Singletons library
but T1 is only type synonym and long type-level calculation will be done in
any places where I use T1.
So I will have problems with compile-time performance.

Probably I would overcome this if I can define
> class X x where ...
> instance X T1 where ...
but I can't do it because can't define instances for (non-injective) Type

Is there any workaround?
Are there any plans to make it better?
Are there any hidden problems to make an analog of CAF on the type level?

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180413/33894790/attachment.html>

More information about the Haskell-Cafe mailing list