-
Notifications
You must be signed in to change notification settings - Fork 422
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
Type inconsistencies #984
Comments
Both fixes are acceptable (moving everything to Bool or to Int) |
Thanks @matbesancon.
Any thoughts on I can understand the reasoning for the current approach: a regular array-of-vectors is more efficiently stored in a matrix. But the lack of regularity in the interface is a bit painful. It seems like we need a way to store something as a matrix but access it as an array of vectors. I thought I had seen a library that provides this capability, but I'm having trouble finding it right now. Any ideas? |
I'm good with Bool on this, the fact that Bool is an Integer is helpful here.
We have to keep in mind that the standard method is always rand(RNG, dist::Distribution, n::Integer) :: AbstractArray{T} The
RecursiveArrayTools.jl could do the job |
I had thought this too, but it seems to solve the problem of treating a vector-of-vectors as a matrix, while we need to go the other way. A few years ago I saw a nice approach in Haskell that gave a nice way to build abstractions on customized efficient internal representations. I'll see if I can find it, in case it's not too Haskell-specific; maybe some of the ideas can apply here |
If it improves consistency it's fine, we can always add breaking changes |
There are some serious type inconsistencies here:
Can we please have
rand(dist) :: T
implyrand(dist, n::Int) :: Array{T}
eltype(dist) == T
?
The text was updated successfully, but these errors were encountered: