Skip to content

Conversation

anmonteiro
Copy link
Member

@anmonteiro anmonteiro commented Nov 16, 2023

part of the unification proposed in #731

@jchavarri
Copy link
Member

What is the policy for naming of modules in Js? After this change, WeakSet and WeakMap will use pascal case, while Typed_array will use snake case. Shouldn't the latter be called TypedArray for consistency?

Copy link
Member

@jchavarri jchavarri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment on lines +86 to +87
external sortInPlace : t -> t = "sort" [@@mel.send]\
external sortInPlaceWith : t -> f:(elt -> elt -> int [@u]) -> t = "sort" [@@mel.send]\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could consolidate these two making f optional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do this one on purpose because then you'd need the unit argument to sortInPlace. I feel like the tradeoff is justified when there are other labeled arguments but perhaps not in this case.

If you feel strongly, we can reconsider. I think Js.Array and Js.String have similarly duplicated sorting functions.

\
external subarray : start:int -> end_:int -> t = "subarray" [@@mel.send.pipe: t]\
external subarray : t -> start:int -> ?end_:int -> unit -> t = "subarray" [@@mel.send]\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end

open struct
module Js = Js_internal
end

module type S = sig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this used for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea. The way I've been handling these migrations has been to move foo2.ml to foo.ml. So this wasn't present in Js_typed_array2. I don't think we need to keep it.

@anmonteiro anmonteiro force-pushed the anmonteiro/migrate-js-typed-array branch from d7803f7 to 4a4ec0b Compare November 18, 2023 00:24
@anmonteiro anmonteiro merged commit 87673e6 into main Nov 18, 2023
@anmonteiro anmonteiro deleted the anmonteiro/migrate-js-typed-array branch November 18, 2023 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants