[Haskell-cafe] Incredibly slow type-level Nub
nickolay.kudasov at gmail.com
Mon Feb 8 20:34:57 UTC 2016
Well, actually, I was not aware that singletons provide this functionality!
>From what I see singletons seem to be an overkill for my use case.
Thanks for the hint though, I will look into singletons more to see if it
fits the bill.
On Mon, 8 Feb 2016 at 13:21 Dmitry Olshansky <olshanskydr at gmail.com> wrote:
> I wonder if singletons <https://hackage.haskell.org/package/singletons> library
> doesn't satisfy your requrements? Did you look at this opportunity? Here
> <https://hackage.haskell.org/package/singletons-2.0.1/docs/Data-Promotion-Prelude-List.html#t:Nub> is
> a Nub implementation.
> I am particulary interested in this because I am checking now this library
> for usung it in my project. Had you some reasons to refuse it?
> Best regards,
> 2016-02-07 16:37 GMT+03:00 Nickolay Kudasov <nickolay.kudasov at gmail.com>:
>> Dear Cafe,
>> I have faced a type-level performance problem (with GHC 7.10.3).
>> I am trying to implement type-level Nub which removes duplicates from a
>> type-level list.
>> My implementation  with an example of a list of length 20 takes
>> forever to compile. If you reduce the size of the example list (e.g. to 15
>> items), it will compile faster. Also, if you remove the Nub application
>> from exampleVals, it compiles instantly (this is how I know the problem is
>> in Nub).
>> My question is how can I speed up type-level Nub?
>> And less importantly why exactly is it this slow?
>> The practical application for this is building automatic tests  for
>> servant-swagger. There I am interested in generating exactly one test for
>> each distinct type.
>> Kind regards,
>>  https://gist.github.com/fizruk/06458fe8b62a1e562af1
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe