CW2011

continuation workshop 2011 & tutorial session.
4

*** *** tutorial (Sep. 23) *** ***

shelarcy(しぇらーしぃ) @shelarcy

@tanakh OchaCaml の例を限定継続モナドを使って書いたものがここにあるので、参考にしてみてください。 http://t.co/KKVsnF3b

2011-09-23 18:46:35
shelarcy(しぇらーしぃ) @shelarcy

「liboleg から限定継続モナドだけ切り離して欲しい」「oleg さんに限定継続モナドだけ別にアップロードしたいと言えば良いのでは?」 #continuation #ICFP

2011-09-23 18:53:41

*** OchaCaml ***

日比野 啓 (Kei Hibino) @khibino

If you are gcc-4.6.1 user, remove -no-cpp-precomp switch from OPTS variable of cl75/src/Makefile. #icfp #cont2011

2011-09-23 19:06:04
Yu SUGAWARA @gusmachine

ああ、よくこの "clears continuation"を忘れてこんがらがる #cont2011

2011-09-23 19:18:16
Yu SUGAWARA @gusmachine

ふむ。 let f = fun() -> 3 + shift (fun _ -> 2) in reset f - 1;; #cont2011

2011-09-23 19:21:21
Yu SUGAWARA @gusmachine

# let discarder x = shift (fun _ -> x);; discarder : 'a => 'b = <fun> こんなことができるのか #cont2011

2011-09-23 19:26:56
山本和彦 @kazu_yamamoto

OchaCaml が readline に対応していないので辛い。 #cont2011

2011-09-23 19:27:17
山本和彦 @kazu_yamamoto

OCaml ってカリー化されてないんだっけ? #cont2011

2011-09-23 19:33:34
Yu SUGAWARA @gusmachine

# let here = shift (fun k -> k);;This expression is not pure.Answer types are 'e and 'f / 'g -> 'e / 'g.うーん. #cont2011

2011-09-23 19:36:04
Yu SUGAWARA @gusmachine

@MoCo7 いちいち shift (fun k->k)を書くのが面倒なのでletしてみたのでした. これは横着せずちゃんと書かないと駄目みたいですね..

2011-09-23 19:38:27
mοe @MoCo7

@gusmachine ああ、thunk にするのはどうでしょう。shift は呼び出されたときに実行されてしまうので。let here () = shift (fun k -> k) ();; で here ()。

2011-09-23 19:40:00
Yu SUGAWARA @gusmachine

# let here = fun () -> shift (fun k -> k);;here : unit => 'a = <fun>できた. #cont2011

2011-09-23 19:43:36
Yu SUGAWARA @gusmachine

そして、 # reset (fun () -> 1::2::3::here ()) [6;5;4];;- : int list = [1; 2; 3; 6; 5; 4]#cont2011

2011-09-23 19:43:53
Yu SUGAWARA @gusmachine

型が読めない.. This expression has type unit / 'a -> 'b / ('b / 'c -> 'a / 'c), but is used with type int list. #cont2011

2011-09-23 19:44:27
Yu SUGAWARA @gusmachine

今のうちにつぎのTree traverseのところを読んでいる #cont2011

2011-09-23 19:56:22

*** Haskell ***

1 ・・ 8 次へ