pickRandom
should not look at element types, in my opinion.
#1974
Labels
pickRandom
should not look at element types, in my opinion.
#1974
pickRandom
wants a one-dimensional array. I understand the design decision, but it still feels not so intuitive, I expectpickRandom
to only look at the length of my array and then return the element at a random index. So e.g.math.pickRandom([[0, 1], [2, 3]])
should randomly return either[0, 1]
or[2, 3]
. After all,pickRandom([0, [1, 2], [3, 4]])
works as expected. Even if we pretend that JS is a strictly typed language with no mixed arrays, I'd expectpickRandom
to be of typeforall a. [a] -> M a
whereM
is a suitable monad.The text was updated successfully, but these errors were encountered: