Archive for the 'haskell' Category

Apr 13 2009

Stupid Haskell Tricks

Published by tim under coding, haskell

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 [...]

No responses yet

Next »