Clause
← All documentation

Library modules

Plan 11 step 39 (2026-10-07): a project-owned subset of OTP's lists and maps modules, written in Erlang from OTP's documented behavior (not copied from OTP sources) and compiled with the programs that use it.

Contents

ModuleFunctions
listsappend/1,2, filter/2, foldl/3, foldr/3, keyfind/3, map/2, member/2, nth/2, reverse/1,2, seq/2,3, sort/1
mapsfind/2, fold/3, from_list/1, get/2, keys/1, put/3, to_list/1, values/1
fileopen/2, read/2, write/2, read_line/1, position/2, close/1, read_file/1, write_file/2, delete/1, rename/2, list_dir/1, make_dir/1, del_dir/1 over the file driver (files)
ioget_line/1,2, get_chars/2,3 (standard input server or an open file); format/1,2 and put_chars/1 are runtime builtins
gen_tcplisten/2, accept/1,2, connect/3,4, send/2, recv/2,3, shutdown/2, controlling_process/2, close/1 over socket ports (sockets)
gen_udpopen/1,2, send/4, recv/2,3, controlling_process/2, close/1
inetport/1, sockname/1, peername/1, setopts/2, close/1
clause_socketClause's own: the socket driver protocol the three modules above share
oscmd/1 over a port (subprocesses); type/0 and getenv/1 are runtime builtins

Results and error reasons match OTP 29, including the error shapes of OTP's Erlang implementations (lists:map(F, x) is {case_clause, x}, lists:nth(0, L) function_clause, lists:seq(1, 10, 0) badarg) and of its BIFs (lists:member/2, lists:keyfind/3, lists:reverse/2, the maps functions: badarg, {badmap, M}, {badkey, K}). lists:member/2 matches with =:=, lists:keyfind/3 with ==. lists:sort/1 is a stable merge sort. Stack traces name the library functions, not OTP's.

How programs get them