[ create a new paste ] login | about

Link: http://codepad.org/wBwynlGt    [ raw code | output | fork ]

Haskell, pasted on Mar 18:
1
2
3
4
5
myFn :: Num a => [a] -> [a]
myFn []     = []
myFn (x:xs) = x + 1 : (myFn $ map (+1) xs)

main = print $ myFn [1,1,1,1,1]  -- Prints [2,3,4,5,6]


Output:
1
[2,3,4,5,6]


Create a new paste based on this one


Comments: