You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The laws for Random are probably best tested with something like TestU01?
Probably should introduce a type e.g. GenSpawnRandom that extends both Spawn and Random and has laws asserting the statistical independence of the spawned fibers. In fact, this should probably extend down the entire Spawn hiearchy, and when users want both Random and Spawn/Concurrent/Temporal/etc. they should really ask for e.g. ConcurrentRandom assuming they want this guarantee of statistical independence (i.e., almost always).
There is some trickiness for MonadError through MonadCancel due to loss of state in error/cancellation channels. A naïve StateT-based implementation of Random would have independence issues here. But I think the only way to observe this issue would be via some side-effect that can only be implemented with Concurrent or Sync. So maybe also a SyncRandom type is needed, with corresponding laws to enforce statistical independence in these cases as well *grumble*.
Finally, what to do about the distribution families. I wonder if their laws can be defined in terms of the laws for Random i.e. it should be possible to define Random in terms of any distribution by transforming via the CDF.
The text was updated successfully, but these errors were encountered:
Thoughts:
Random
are probably best tested with something like TestU01?GenSpawnRandom
that extends bothSpawn
andRandom
and has laws asserting the statistical independence of the spawned fibers. In fact, this should probably extend down the entireSpawn
hiearchy, and when users want bothRandom
andSpawn
/Concurrent
/Temporal
/etc. they should really ask for e.g.ConcurrentRandom
assuming they want this guarantee of statistical independence (i.e., almost always).MonadError
throughMonadCancel
due to loss of state in error/cancellation channels. A naïveStateT
-based implementation ofRandom
would have independence issues here. But I think the only way to observe this issue would be via some side-effect that can only be implemented withConcurrent
orSync
. So maybe also aSyncRandom
type is needed, with corresponding laws to enforce statistical independence in these cases as well *grumble*.Random
i.e. it should be possible to defineRandom
in terms of any distribution by transforming via the CDF.The text was updated successfully, but these errors were encountered: