2005-01-02から1日間の記事一覧

可変長引数の関数?

Movedのminor nit. イヤなことにはかわりなし。 class VAFun a r f | f -> r where withVAList :: ([a] -> r) -> f instance VAFun a Int Int where withVAList g = g [] instance VAFun a r x => VAFun a r (a -> x) where withVAList g x = withVAList (g …

Continuation Monad (1)

t-y-schemeの継続についての章であるChapter 13をHaskellで書いてみる。まず13.1章。 13.1 call-with-current-continuation Example 1 (+ 1 (call/cc (lambda (k) (+ 2 (k 3))))) => 4 Continuationモナドを利用する。(+)や整数リテラルがtype classのメソッ…

新年おめでとうございます。