module Main
(main) where
for :: Applicative f => a -> (a -> Bool) -> (a -> a) -> (a -> f ()) -> f ()
for initial condition step body
| condition initial = body initial *> for (step initial) condition step body
| otherwise = pure ()
main :: IO ()
main =
for 0 (< 10) (+ 1) $ \i ->
print i