Yes, there are list comprehensions but they return the list of values:
(lc ((<- x (lists:seq 1 10))) (lfe_io:format "~p" x))
(lc ((<- x (lists:seq 1 10))) (lfe_io:format "~p" x))
> (lists:map (lambda (a) (io:format (integer_to_list a))) (lists:seq 1 10))
Though all those OKs look kind of superfluous. I must read Erlang tutorial or two before I proceed.If you want to create a list of strings, this works:
> (lists:map (lambda (a) (lists:flatten (io_lib:format "~B" (list a)))) (lists:seq 1 10)).
("1" "2" "3" "4" "5" "6" "7" "8" "9" "10")