Apr 13 2009
Stupid Haskell Tricks
Let’s say that you really, really want some notion of objected oriented programming. So let’s make a class that represents a name, and some simple method calls on it:
data S = S { name :: String } deriving (Show)
firstname s = (words (name s))!!0
lastname s = (words (name s))!!1
But, dammit, you want to [...]