[ create a new paste ] login | about

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

johannes - Haskell, pasted on Aug 7:
1
2
3
4
5
6
7
module Main where

doubled (x:xs) = x+x : doubled xs
numbers = [1..]
doubledNumbers = doubled numbers

main = print (take 5 doubledNumbers)


Output:
1
[2,4,6,8,10]


Create a new paste based on this one


Comments: