instance (Num a) => Num [a] where
xs + ys = [x + y | x <- xs, y <- ys ]
xs * ys = [x * y | x <- xs, y <- ys ]
abs = map abs
signum = map signum
fromInteger x = [fromInteger x :: (Num a) => a]
xs * ys = [x * y | x <- xs, y <- ys ]
Have you read your Monads today?
Name:
Anonymous2013-03-13 15:06
HASKAL THE DEAD NOSE
Name:
Anonymous2013-03-13 15:26
Haskell is very hard, but even after 3 years of pretty intensive use, I never really felt productive with haskell in the same way that I've felt in other languages. Anything I did in haskell required a lot of thinking up-front and tinkering in the REPL to make sure the types all agreed and it was rather time-consuming to assemble a selection of data types and functions that mapped adequately onto the problem I was trying to solve. More often than not, the result was something of an unsightly jumble that would take a long time to convert into nicer-looking code or to make an API less terrible to use.