Skip to content

Commit 03d258c

Browse files
committed
Use implicit parameters in find_table function
1 parent bb11994 commit 03d258c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

formats/opentype.fathom

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ def table_directory (file_start : Pos) = {
8888
fun (table_id : Repr tag) =>
8989
fun (table_format : Format) => {
9090
// TODO: let formats
91-
table_record <- unwrap (Repr table_record) (find_table _ table_records table_id),
91+
table_record <- unwrap (Repr table_record) (find_table table_records table_id),
9292
link <- link_table file_start table_record table_format,
9393
};
9494

9595
let required_table_with_len =
9696
fun (table_id : Repr tag) =>
9797
fun (table_format : (U32 -> Format)) => {
9898
// TODO: let formats
99-
table_record <- unwrap (Repr table_record) (find_table _ table_records table_id),
99+
table_record <- unwrap (Repr table_record) (find_table table_records table_id),
100100
link <- link_table file_start table_record (table_format table_record.length),
101101
};
102102

@@ -105,7 +105,7 @@ def table_directory (file_start : Pos) = {
105105
fun (table_format : Format) =>
106106
option_fold (Repr table_record) Format {}
107107
(fun record => link_table file_start record table_format)
108-
(find_table _ table_records table_id);
108+
(find_table table_records table_id);
109109

110110
{
111111
// Required Tables
@@ -291,7 +291,7 @@ def table_record = {
291291

292292
/// Find a table record using the given `table_id`.
293293
def find_table =
294-
fun (num_tables : U16) =>
294+
fun (@num_tables : U16) =>
295295
fun (table_records : Array16 num_tables (Repr table_record)) =>
296296
fun (table_id : Repr tag) =>
297297
// TODO: accelerate using binary search

formats/opentype.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def table_record : Format = {
66
offset <- u32be,
77
length <- u32be,
88
};
9-
def find_table : fun (num_tables : U16) -> Array16 num_tables {
9+
def find_table : fun (@num_tables : U16) -> Array16 num_tables {
1010
table_id : U32,
1111
checksum : U32,
1212
offset : U32,
@@ -17,7 +17,7 @@ def find_table : fun (num_tables : U16) -> Array16 num_tables {
1717
offset : U32,
1818
length : U32,
1919
} =
20-
fun num_tables table_records table_id => array16_find num_tables (Repr table_record) (fun table_record => table_record.table_id == table_id) table_records;
20+
fun @num_tables table_records table_id => array16_find num_tables (Repr table_record) (fun table_record => table_record.table_id == table_id) table_records;
2121
def link_table : Pos -> {
2222
table_id : U32,
2323
checksum : U32,
@@ -1037,16 +1037,16 @@ def table_directory : Pos -> Format = fun file_start => {
10371037
table_records <- array16 num_tables table_record,
10381038
table_links <- let required_table : U32 -> Format -> Format =
10391039
fun table_id table_format => {
1040-
table_record <- unwrap (Repr table_record) (find_table num_tables table_records table_id),
1040+
table_record <- unwrap (Repr table_record) (find_table @num_tables table_records table_id),
10411041
link <- link_table file_start table_record table_format,
10421042
};
10431043
let required_table_with_len : U32 -> (U32 -> Format) -> Format =
10441044
fun table_id table_format => {
1045-
table_record <- unwrap (Repr table_record) (find_table num_tables table_records table_id),
1045+
table_record <- unwrap (Repr table_record) (find_table @num_tables table_records table_id),
10461046
link <- link_table file_start table_record (table_format table_record.length),
10471047
};
10481048
let optional_table : U32 -> Format -> Format =
1049-
fun table_id table_format => option_fold (Repr table_record) Format () (fun record => link_table file_start record table_format) (find_table num_tables table_records table_id);
1049+
fun table_id table_format => option_fold (Repr table_record) Format () (fun record => link_table file_start record table_format) (find_table @num_tables table_records table_id);
10501050
{
10511051
cmap <- required_table "cmap" cmap_table,
10521052
head <- required_table "head" head_table,

0 commit comments

Comments
 (0)