[racket] choice-evt: quadratic?

From: Tony Garnock-Jones (tonyg at ccs.neu.edu)
Date: Thu Dec 15 15:56:51 EST 2011

Hi all,

Converting a number of alternative events into a single event by folding 
choice-evt over them one-at-a-time takes O(n^2) time.

What should I do instead?

(apply choice-evt the-list) takes O(n) time, but is a bit annoying 
because I have to maintain the intermediate list explicitly, and it's a 
bit gross in that it's using apply.

Would it make sense to consider changing choice-evt to be "lazy" 
internally somehow, to defer flattening the branches of the choice until 
it comes time to synchronise?


Posted on the users mailing list.