grr. this has nothing to do with haskell.
The only big Haskell feature here is a default implementation of binary exponentiation, but this is a library feature, not an innate feature of the language. It would be easy enough to augment existing standard Python libraries with such a corresponding feature.
(1 % 2) :+ (1 % 2)
Gives much more useful information than: <__main__.Qsqrt5 instance at 0xffee4d6c>
In fact, it encodes the same information given by your __str__ with the added benefit that it can be read back into a Q5 value: 1/2 + 1/2 sqrt(5)
Of course, yours would be nicer to display to someone unfamiliar with Haskell's type constructors. No arguing that. But it's also clear that Haskell's derived show trumps Python's default __str__/__repr__.I've noticed that people with a mathematical background tend to be very attracted to Haskell. There's a great blog post by Dan Piponi enumerating eleven reasons to use Haskell as a mathematician:
http://blog.sigfpe.com/2006/01/eleven-reasons-to-use-haskell...
Or perhaps people who care about foundations in general.