Skip to content

Commit 901c977

Browse files
committed
stdlib: scaffold ets ffi
Works on #8
1 parent 9c3d052 commit 901c977

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/stdlib/beam/stdlib_ets.ml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
type ('k, 'v) tid
2+
3+
type table_type = [ `Set | `Ordered_set | `Bag | `Duplicate_bag ]
4+
5+
type access = [ `Public | `Protected | `Private ]
6+
7+
type concurrency = [ `Write_concurrency of bool | `Read_concurrency of bool ]
8+
9+
type make_opt =
10+
[ access
11+
| concurrency
12+
| table_type
13+
| `Named_table
14+
| `Decentralized_counters of bool
15+
| `Compressed ]
16+
17+
external make : 'a -> make_opt list -> ('k, 'v) tid = "new"
18+
19+
external lookup : ('k, 'v) tid -> 'k -> 'v list = ""
20+
21+
external insert_one : ('k, 'v) tid -> 'k * 'v -> unit = "insert"
22+
23+
external insert_many : ('k, 'v) tid -> ('k * 'v) list -> unit = "insert"
24+
25+
external foldl : ('k * 'v -> 'acc -> 'acc) -> 'acc -> ('k, 'v) tid -> 'acc = ""
26+
27+
external foldr : ('k * 'v -> 'acc -> 'acc) -> 'acc -> ('k, 'v) tid -> 'acc = ""

0 commit comments

Comments
 (0)