LISP Macro みたいなことできますか?
-- dotimes :: n -> (n -> IO()) -> IO()
dotimes n f = __dotimes 0
where __dotimes i | i >= n = return ()
| otherwise = do (f i)
__dotimes (i + 1)
-- dotimes 10 ( \x -> putStr (show x))
こんなもの?