File tree 2 files changed +10
-1
lines changed 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,8 @@ putNat n = State putNat'
26
26
setExitCode :: Nat -> IO ()
27
27
setExitCode n = State setExitCode'
28
28
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
Original file line number Diff line number Diff line change @@ -232,3 +232,8 @@ zipWith :: (a -> b -> c) -> List a -> List b -> List c
232
232
zipWith f (Cons x xs) (Cons y ys) = (f x y) `Cons ` (zipWith f xs ys)
233
233
zipWith f Nil ys = Nil
234
234
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
You can’t perform that action at this time.
0 commit comments