rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Add more types for Random

Open zofrex opened this issue 5 years ago • 0 comments

This is my first time writing RBS so I am not sure it is right, especially the tests.

I am not sure how to fully describe rand because it can return whatever type you give it, for example:

> Random.rand(Tally.new("|")..Tally.new("|||||"))
=> #<Tally:0x00007fedf725f9f8 @string="|">

In other words, rand: (Range[SomeType]) -> SomeType but I don't know how to write that in RBS.

(Also, I think SomeType might have to be a descendent of Numeric, but the documentation is not clear)

zofrex avatar Nov 09 '20 12:11 zofrex