Skip to content

Commit f2f7a5a

Browse files
committed
something strange
1 parent 830fe20 commit f2f7a5a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ITMOPrelude/IO.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ putNat n = State putNat'
2626
setExitCode :: Nat -> IO ()
2727
setExitCode n = State setExitCode'
2828
where setExitCode' world = (newWorld, ())
29-
where newWorld = RealWorld (stdIn world) (stdOut world) n
29+
where newWorld = RealWorld (stdIn world) (stdOut world) n
30+
31+
testInfinite :: List Nat -> IO ()
32+
testInfinite Nil = return ()
33+
testInfinite (Cons x xs) = putNat x >> testInfinite xs

ITMOPrelude/List.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,8 @@ zipWith :: (a -> b -> c) -> List a -> List b -> List c
232232
zipWith f (Cons x xs) (Cons y ys) = (f x y) `Cons` (zipWith f xs ys)
233233
zipWith f Nil ys = Nil
234234
zipWith f xs Nil = Nil
235+
236+
iterate f x = x `Cons` iterate' x
237+
where iterate' x = x `Cons` (iterate' $ f x)
238+
239+
nats = iterate Succ Zero

0 commit comments

Comments
 (0)