Earlier quoted context omitted.
Satisfying arbitrary constraints is often exponential ( http://en.wikipedia.org/wiki/Boolean_satisfiability_problem ). I'd certainly be interested in seeing more efficient implementations, but the approach taken by the example Haskell code (and duplicated in your Python) is substantially more efficient than the example non-Haskell code provided in the article.
I know about BSAT / BIP / ILP / MLP and the problems thereof in the general case. However, this doesn't mean we have to punt the easy cases just because there are hard cases.
That no one seems to have produced (or pointed at) an asymptotically better solution in any language, I think that's some small evidence that there isn't such a solution and substantially more evidence that it's not easy to find.