関数型プログラミング ..
548:デフォルトの名無しさん
05/05/01 20:14:08
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))
こんなもの?
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5388日前に更新/259 KB
担当:undef