Ad
Code
Diff
  • module InfiniteSeq where
    
    import Data.List
    
    ones = repeat 1
    nats = [0..]
    
    merge = concat . transpose
    merge2 x y = merge [x, y]
    
    ints = 0: merge2 [1..] [(-1),(-2)..]
    
    fibs = 1 : scanl (+) 1 fibs
    • module InfiniteSeq where
    • import Data.List
    • ones = repeat 1
    • nats = [0..]
    • merge = concat . transpose
    • merge2 x y = merge [x, y]
    • ints = 0: merge2 [1..] [(-1),(-2)..]
    • fibs = 1 : scanl (+) 1 fibs