プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

add koka

Kohei Watanabe (Nov 21, 2025, 10:48 PM +0900) 82f93470 2db87b25

+14
+14
koka/hello-world.kk
··· 1 + // A generator effect with one operation 2 + effect yield<a> 3 + fun yield( x : a ) : () 4 + 5 + // Traverse a list and yield the elements 6 + fun traverse( xs : list<a> ) : yield<a> () 7 + match xs 8 + Cons(x,xx) -> { yield(x); traverse(xx) } 9 + Nil -> () 10 + 11 + fun main() : console () 12 + with fun yield(i : char) 13 + println("yielded " ++ i.show) 14 + "Hello, World!".list.traverse