Skip to content

Minor gentype fixes #7109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/gentype/GenTypeMain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ let process_cmt_file cmt =
Log_.Color.setup ();
Log_.info ~loc ~name:"Warning genType" (fun ppf () ->
Format.fprintf ppf
"Annotation is ignored as there's a .rei file"));
"Annotation is ignored as there's a .resi file"));
true)
else false)
in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ module Array = {

let rangeBy = (x, y, ~step) => Array.rangeBy(x, y, ~step)->toT

let makeByU = (c, f) => Array.makeByU(c, f)->toT
let makeBy = (c, f) => Array.makeBy(c, x => f(x))->toT

let makeByAndShuffleU = (c, f) => Array.makeByAndShuffleU(c, f)->toT
let makeByAndShuffle = (c, f) => Array.makeByAndShuffle(c, x => f(x))->toT

let zip = (a1, a2) => Array.zip(fromT(a1), fromT(a2))->toTp

let zipByU = (a1, a2, f) => Array.zipByU(fromT(a1), fromT(a2), f)->toT
let zipBy = (a1, a2, f) => Array.zipBy(fromT(a1), fromT(a2), (x, y) => f(x, y))->toT

let unzip = a => Array.unzip(a->fromTp)->toT2
Expand All @@ -66,53 +63,37 @@ module Array = {

let copy = a => Array.copy(a->fromT)->toT

let forEachU = (a, f) => Array.forEachU(a->fromT, f)
let forEach = (a, f) => Array.forEach(a->fromT, x => f(x))

let mapU = (a, f) => Array.mapU(a->fromT, f)->toT
let map = (a, f) => Array.map(a->fromT, x => f(x))->toT

let keepWithIndexU = (a, f) => Array.keepWithIndexU(a->fromT, f)->toT
let keepWithIndex = (a, f) => Array.keepWithIndex(a->fromT, (x, y) => f(x, y))->toT

let keepMapU = (a, f) => Array.keepMapU(a->fromT, f)->toT
let keepMap = (a, f) => Array.keepMap(a->fromT, x => f(x))->toT

let forEachWithIndexU = (a, f) => Array.forEachWithIndexU(a->fromT, f)
let forEachWithIndex = (a, f) => Array.forEachWithIndex(a->fromT, (x, y) => f(x, y))

let mapWithIndexU = (a, f) => Array.mapWithIndexU(a->fromT, f)->toT
let mapWithIndex = (a, f) => Array.mapWithIndex(a->fromT, (x, y) => f(x, y))->toT

let partitionU = (a, f) => Array.partitionU(a->fromT, f)->toT2
let partition = (a, f) => Array.partition(a->fromT, x => f(x))->toT2

let reduceU = (a, b, f) => Array.reduceU(a->fromT, b, f)
let reduce = (a, b, f) => Array.reduce(a->fromT, b, (x, y) => f(x, y))

let reduceReverseU = (a, b, f) => Array.reduceReverseU(a->fromT, b, f)
let reduceReverse = (a, b, f) => Array.reduceReverse(a->fromT, b, (x, y) => f(x, y))

let reduceReverse2U = (a1, a2, c, f) => Array.reduceReverse2U(fromT(a1), fromT(a2), c, f)
let reduceReverse2 = (a1, a2, c, f) =>
Array.reduceReverse2(fromT(a1), fromT(a2), c, (x, y, z) => f(x, y, z))

let someU = (a, f) => Array.someU(a->fromT, f)
let some = (a, f) => Array.some(a->fromT, x => f(x))

let everyU = (a, f) => Array.everyU(a->fromT, f)
let every = (a, f) => Array.every(a->fromT, x => f(x))

let every2U = (a1, a2, f) => Array.every2U(fromT(a1), fromT(a2), f)
let every2 = (a1, a2, f) => Array.every2(fromT(a1), fromT(a2), (x, y) => f(x, y))

let some2U = (a1, a2, f) => Array.some2U(fromT(a1), fromT(a2), f)
let some2 = (a1, a2, f) => Array.some2(fromT(a1), fromT(a2), (x, y) => f(x, y))

let cmpU = (a1, a2, f) => Array.cmpU(fromT(a1), fromT(a2), f)
let cmp = (a1, a2, f) => Array.cmp(fromT(a1), fromT(a2), (x, y) => f(x, y))

let eqU = (a1, a2, f) => Array.eqU(fromT(a1), fromT(a2), f)
let eq = (a1, a2, f) => Array.eq(fromT(a1), fromT(a2), (x, y) => f(x, y))
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ let range: (int, int) => t<int>

let rangeBy: (int, int, ~step: int) => t<int>

let makeByU: (int, int => 'a) => t<'a>
let makeBy: (int, int => 'a) => t<'a>

let makeByAndShuffleU: (int, int => 'a) => t<'a>
let makeByAndShuffle: (int, int => 'a) => t<'a>

let zip: (t<'a>, t<'b>) => t<('a, 'b)>

let zipByU: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>
let zipBy: (t<'a>, t<'b>, ('a, 'b) => 'c) => t<'c>

let unzip: t<('a, 'a)> => (t<'a>, t<'a>)
Expand All @@ -61,50 +58,34 @@ let sliceToEnd: (t<'a>, int) => t<'a>

let copy: t<'a> => t<'a>

let forEachU: (t<'a>, 'a => unit) => unit
let forEach: (t<'a>, 'a => unit) => unit

let mapU: (t<'a>, 'a => 'b) => t<'b>
let map: (t<'a>, 'a => 'b) => t<'b>

let keepWithIndexU: (t<'a>, ('a, int) => bool) => t<'a>
let keepWithIndex: (t<'a>, ('a, int) => bool) => t<'a>

let keepMapU: (t<'a>, 'a => option<'b>) => t<'b>
let keepMap: (t<'a>, 'a => option<'b>) => t<'b>

let forEachWithIndexU: (t<'a>, (int, 'a) => unit) => unit
let forEachWithIndex: (t<'a>, (int, 'a) => unit) => unit

let mapWithIndexU: (t<'a>, (int, 'a) => 'b) => t<'b>
let mapWithIndex: (t<'a>, (int, 'a) => 'b) => t<'b>

let partitionU: (t<'a>, 'a => bool) => (t<'a>, t<'a>)
let partition: (t<'a>, 'a => bool) => (t<'a>, t<'a>)

let reduceU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b
let reduce: (t<'a>, 'b, ('b, 'a) => 'b) => 'b

let reduceReverseU: (t<'a>, 'b, ('b, 'a) => 'b) => 'b
let reduceReverse: (t<'a>, 'b, ('b, 'a) => 'b) => 'b

let reduceReverse2U: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c
let reduceReverse2: (t<'a>, t<'b>, 'c, ('c, 'a, 'b) => 'c) => 'c

let someU: (t<'a>, 'a => bool) => bool
let some: (t<'a>, 'a => bool) => bool

let everyU: (t<'a>, 'a => bool) => bool
let every: (t<'a>, 'a => bool) => bool

let every2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool
let every2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool

let some2U: (t<'a>, t<'b>, ('a, 'b) => bool) => bool
let some2: (t<'a>, t<'b>, ('a, 'b) => bool) => bool

let cmpU: (t<'a>, t<'a>, ('a, 'a) => int) => int
let cmp: (t<'a>, t<'a>, ('a, 'a) => int) => int

let eqU: (t<'a>, t<'a>, ('a, 'a) => bool) => bool
let eq: (t<'a>, t<'a>, ('a, 'a) => bool) => bool
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type opaqueVariant =
| A
| B

@genType let stringT: String.t = "a"
@genType let stringT: string = "a"

@genType let jsStringT: Js.String.t = "a"

Expand Down