-
Notifications
You must be signed in to change notification settings - Fork 56
Description
… as far as random library is concerned, this global generator was already almost deprecated in 1.2.0 and we chose not to do it for now for backwards compatibility and reduction of breakage, but it definitely will be in the next major release …
The reason, as far as I can understand from the explanation given there, is that a broken value may be assigned to theStdGen in one place, making it unusable everywhere else, across all build units and scopes. It seems to be implied that randomIO and similar functions that make use of theStdGen to provide a cleaner user experience are slated for removal.
I wonder if instead theStdGen may be made internal, allowing it to be used only by functions defined in the library itself. Then it could be made sure that it cannot be broken. Therefore randomIO and friends could stay.
Has this been considered?
Also mentioning @lehins since he is the source of my information.