main
= print $ mysum
[1,2]
mysum
:: Num a
=> [a
] => a
-- Notice => after the list [a]mysum [] = 0
mysum (x:xs) = x + mysum xs
bWFpbiA9IHByaW50ICQgbXlzdW0gWzEsMl0KCm15c3VtIDo6IE51bSBhID0+IFthXSA9PiBhIC0tIE5vdGljZSA9PiBhZnRlciB0aGUgbGlzdCBbYV0KbXlzdW0gW10gPSAwCm15c3VtICh4OnhzKSA9IHggKyBteXN1bSB4cw==