Performance of TL-calculations

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Performance of TL-calculations

Dmitry Olshansky
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 Families.

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,

Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.