on master help sign in
Idris-dev/test/basic004/test016.idr
17 lines 307 B history raw
1module Main
3%default total
5codata Stream' a = Nil | (::) a (Stream' a)
7countFrom : Int -> Stream' Int
8countFrom x = x :: countFrom (x + 1)
10take : Nat -> Stream' a -> List a
11take Z _ = []
12take (S n) (x :: xs) = x :: take n xs
13take n [] = []
15main : IO ()
16main = do printLn (take 10 (Main.countFrom 10))