Yoda speaks Visual Haskell

Created 2007-08-18T12:29:42.261Z, last edited 2007-08-18T12:29:42.464Z

I was researching an article for kirit.com on “zeugma” and came across a Yoda quote on Wikipedia:

Fear leads to anger. Anger leads to hate. Hate leads to suffering.

This is an example of hypozeuxis which means the repetition of the same verb for several subjects. It immediately struck me that this would be a perfect thing to try for my first foray into Haskell. I also figured it would be interesting for people who hadn't tried Haskell before.

So what we're going to do is to start with a list like this:

[ "fear", "anger", "hate", "suffering" ]

And end up with a string like this:

"Fear leads to anger. Anger leads to hate. Hate leads to suffering."