While #6 is about getting support for a set of OCaml language features, this issue is about putting together a standard library that can be used to interface with the Erlang standard library in a more-or-less idiomatic way.
This likely means 2 things: FFIs and a small runtime library. Some modules might be a combination of both.
Checklist
FFIs
In any case, some of these modules will have to break direct compatibility with their Erlang equivalents due to their APIs being uncomfortably unidiomatic OCaml or untypeable in OCaml.
[x] Binary
[x] at/2
[x] bin_to_list/1
[x] copy/2
[x] decode_unsigned/2
[x] encode_unsigned/2
[x] first/1
[x] last/1
[x] list_to_bin/1
[x] replace/4
[x] split/2
[x] Calendar
[x] local_time/0
[x] universal_time/0
[x] Erlang -- this is actually an ERTS preloaded module
[x] is_atom/1
[x] is_binary/1
[x] is_bitstring/1
[x] is_boolean/1
[x] is_float/1
[x] is_integer/1
[x] is_list/1
[x] is_map/1
[x] is_number/1
[x] is_pid/1
[x] is_port/1
[x] is_process_alive/1
[x] is_reference/1
[x] is_tuple/1
[x] length/1
[x] self/0
[x] send/2
[x] spawn/1
[x] throw/1
[x] Ets
[x] foldl/3
[x] foldr/3
[x] insert/2
[x] lookup/2
[x] new/2
[x] Io
[x] format/2
[x] Lists
[x] all/2
[x] any/2
[x] append/1
[x] concat/1
[x] delete/2
[x] droplast/1
[x] dropwhile/2
[x] duplicate/2
[x] filter/2
[x] flatmap/2
[x] flatten/1
[x] foldl/3
[x] foldr/3
[x] foreach/2
[x] join/2
[x] last/1
[x] map/2
[x] max/1
[x] member/2
[x] min/1
[x] partition/2
[x] reverse/1
[x] seq/3
[x] sort/2
[x] split/2
[x] splitwith/3
[x] sublist/2
[x] subtract/2
[x] sum/1
[x] takewhile/2
[x] unzip/1
[x] zip/2
[x] zipwith/3
[x] Maps
[x] filter/2
[x] find/2
[x] fold/3
[x] from_list/1
[x] get/3
[x] is_key/2
[x] keys/1
[x] map/2
[x] merge/2
[x] new/0
[x] put/2
[x] size/1
[x] to_list/1
[x] update/2
[x] values/1
[x] with/2
[x] without/2
[x] Timer
[x] sleep/1
Runtime
These are libraries that actually need the runtime overhead to satisfy some of the type-level constraints.
[x] Process -- as per the experiments i've done on typing message passing, it's likely that we'll need a way to constrain the process types and expose a receive function as a stand in for receive expressions. This module would implement that runtime overhead.
Summary
While #6 is about getting support for a set of OCaml language features, this issue is about putting together a standard library that can be used to interface with the Erlang standard library in a more-or-less idiomatic way.
This likely means 2 things: FFIs and a small runtime library. Some modules might be a combination of both.
Checklist
FFIs
In any case, some of these modules will have to break direct compatibility with their Erlang equivalents due to their APIs being uncomfortably unidiomatic OCaml or untypeable in OCaml.
Binary
at/2
bin_to_list/1
copy/2
decode_unsigned/2
encode_unsigned/2
first/1
last/1
list_to_bin/1
replace/4
split/2
Calendar
local_time/0
universal_time/0
Erlang
-- this is actually an ERTS preloaded moduleis_atom/1
is_binary/1
is_bitstring/1
is_boolean/1
is_float/1
is_integer/1
is_list/1
is_map/1
is_number/1
is_pid/1
is_port/1
is_process_alive/1
is_reference/1
is_tuple/1
length/1
self/0
send/2
spawn/1
throw/1
Ets
foldl/3
foldr/3
insert/2
lookup/2
new/2
Io
format/2
Lists
all/2
any/2
append/1
concat/1
delete/2
droplast/1
dropwhile/2
duplicate/2
filter/2
flatmap/2
flatten/1
foldl/3
foldr/3
foreach/2
join/2
last/1
map/2
max/1
member/2
min/1
partition/2
reverse/1
seq/3
sort/2
split/2
splitwith/3
sublist/2
subtract/2
sum/1
takewhile/2
unzip/1
zip/2
zipwith/3
Maps
filter/2
find/2
fold/3
from_list/1
get/3
is_key/2
keys/1
map/2
merge/2
new/0
put/2
size/1
to_list/1
update/2
values/1
with/2
without/2
Timer
sleep/1
Runtime
These are libraries that actually need the runtime overhead to satisfy some of the type-level constraints.
Process
-- as per the experiments i've done on typing message passing, it's likely that we'll need a way to constrain the process types and expose areceive
function as a stand in forreceive
expressions. This module would implement that runtime overhead.spawn/2
contramap/2
send/2