-
Notifications
You must be signed in to change notification settings - Fork 184
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
New methods and functions in Typed_array #970
Conversation
Thanks for your contribution. What do you think about introducing a new sub module like module Bigarray : sig
val of_int8_signed : (int, int8_signed_elt, c_layout) Bigarray.Array1.t -> int8Array t
val to_int8_signed : int8Array t -> (int, int8_signed_elt, c_layout) Bigarray.Array1.t
val of_int8_unsinged : (int, int8_unsigned_elt, c_layout) Bigarray.Array1.t -> int8Array t
val to_int8_unsigned : int8Array t -> (int, int8_unsigned_elt, c_layout) Bigarray.Array1.t
...
end
|
About the naming, since the Bigarray module is all about GADT i figured it was possible to create two generic In the implementation i had to:
I can always roll back to the previous implementation if needed. |
Thanks.
|
Okey. Should the former bigarray/typed_array conversions still be included in that PR? They would not make sense alongside a polymorphic implementation introduced in another PR. |
Why is that ? I think I'm missing something .. |
In the latest commit (1a8b1d2), I was able to replace the 14 functions ( Those 3 changes are mandatory for the
Reverting those 3 changes means bringing back the 14 previous functions. Sorry if I wasn't clear. |
I don't understand/see why there are mandatory |
To be clear, I'd like to keep |
In On master the method set_fromArray : 'a js_array t -> int -> unit meth
val set : ('a, 'b) typedArray t -> int -> 'a -> unit
val get : ('a, 'b) typedArray t -> int -> 'a optdef
val unsafe_get : ('a, 'b) typedArray t -> int -> 'a In order to be compatible with Bigarray, type int32Array = (int, [ `Int32 ]) typedArray
type uint32Array = (float, [ `Uint32 ]) typedArray should now be: type int32Array = (int32, Bigarray.int32_elt) typedArray
type uint32Array = (int32, Bigarray.int32_elt) typedArray It means that I chose to replace the those 4 functions with 8 non-polymorphic ones ( |
I'm still missing something, why would int32 be problematic ? |
You are right, it works like a charm. It wrongly expected the |
close #971 |
One issue is that we can now call |
Follow-up on #969
getInt16
dodataView
slice
totypedArray
andarrayBuffer
slice_toEnd
totypedArray
andarrayBuffer
*fromGenarray
andtoGenarray
functions