dimitri.lozeve
2020-10-30 09:06:38

@dimitri.lozeve has joined the channel


badkins
2020-10-30 14:09:42

Oh, I don’t like some at all (no pun intended)! To me it implies more than one :)


jbclements
2020-10-30 20:19:46

Aww… many thanks. Let’s be fair, though: Matthias told me to write it :slightly_smiling_face:


wanpeebaw
2020-10-31 00:42:29

Just came across this tutorial and noticed that the functional implementation is much slower than the imperative one. Wonder if there is any way to make it faster without sacrificing purity. https://beautifulracket.com/bf/a-functional-expander.html


sorawee
2020-10-31 00:54:50

I think you want to use things like Okasaki’s random access list rather than a list or a vector here.


sorawee
2020-10-31 00:55:18

Accessing and setting in the random access list can be done in O(log n).


sorawee
2020-10-31 00:55:47

If you use regular list, both accessing and setting takes O(i) = O(n) in worst case.


sorawee
2020-10-31 00:56:03

If you use vector, accessing takes O(1), but setting takes O(n) (in case you want it to be functional, not imperative).


sorawee
2020-10-31 00:57:31

Oh, there’s a random access list library in Racket already too: https://docs.racket-lang.org/ralist/


plragde
2020-10-31 03:00:09

Or Braun trees!