[Haskell-cafe] "Secret Santas" in Haskell / better data structure?

Paul Brown paulrbrown+haskell-cafe at gmail.com
Sat Dec 23 05:31:09 EST 2006


Cafe Crew --

I posted my simple-but-slow solution to Ruby Quiz problem #2:

http://mult.ifario.us/articles/2006/12/22/secret-santas-in-haskell-iii-collect-reap-repeat

(Or http://tinyurl.com/y3l2re if your mail client messes up the URL...)

It's more than practically fast enough unless you have, say 10^8
friends to do secret Santa with, but the problem just cries out for a
well-chosen data structure.  (One obvious improvement over the
approach I posted is to sort the list first, but  maybe there's
something even better...)

As I'm learning, critiques of syntax and usage welcome.  I'll collect
the source and post to the Haskell Quiz wiki as well.

-- Paul


More information about the Haskell-Cafe mailing list