今日のOCaml
Ocamlはlistでtakeが使えん。どうもextlibを使う必要があるらしい。
# #require "extlib";;
/opt/local/lib/ocaml/site-lib/extlib: added to search path
/opt/local/lib/ocaml/site-lib/extlib/extLib.cma: loaded
# open ExtList.List;;
# let a = [1;2;3;4;5;6;7;8;9;0];;
val a : int list = [1; 2; 3; 4; 5; 6; 7; 8; 9; 0]
# take 3 a;;
- : int list = [1; 2; 3]