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
By default, splitmix depends on random. This dependency can be severed by setting a flag. That is currently necessary, otherwise cabal and stack fail to build random due to a dependency circle:
The alternative to depending on the splitmix package is to inline the SplitMix implementation.
Discussion
Pull in splitmix dependency pros:
Whenever improvements are made to splitmix, random can easily benefit from them.
Pull in splitmix dependency cons:
Setting the flag called random to False is required; without it there will be a circular dependency. Flags are supported by cabal and stack, but it looks like e.g. cabal2nix does not support them.
Q: would users need to set this flag too in order to use random?
Copy algorithm pros:
No dependency on splitmix and thus no need to set any flags.
Can reduce the dependency tree overall: some of splitmix' dependencies are not necessary for our purposes and can be removed from the dependency tree.
Copy algorithm cons:
Code duplication.
random does not automatically benefit from updates to splitmix. However, note that the algorithm is now stable - the last change to the PRNG itself occurred in May 2018: Bug in splitmix haskellari/splitmix#9.
The text was updated successfully, but these errors were encountered:
I opened an issue on splitmix about it: haskellari/splitmix#34 I don't see a good reason to inline the splitmix code into random, except only to break the cycle, so in the end it will be @phadej decision on which way the dependency arrow points.
Great, Oleg is ok with dropping dependency on random, so there is no need to duplicate the full implementation. See comment haskellari/splitmix#34 (comment)
Context
Currently there is a dependency on the
splitmix
package:random/random.cabal
Line 38 in a5c70bd
By default,
splitmix
depends onrandom
. This dependency can be severed by setting a flag. That is currently necessary, otherwise cabal and stack fail to buildrandom
due to a dependency circle:random/cabal.project
Line 2 in a5c70bd
random/stack.yaml
Lines 42 to 44 in a5c70bd
Alternative
The alternative to depending on the
splitmix
package is to inline the SplitMix implementation.Discussion
Pull in
splitmix
dependency pros:splitmix
,random
can easily benefit from them.Pull in
splitmix
dependency cons:random
toFalse
is required; without it there will be a circular dependency. Flags are supported by cabal and stack, but it looks like e.g.cabal2nix
does not support them.Q: would users need to set this flag too in order to use
random
?Copy algorithm pros:
splitmix
and thus no need to set any flags.splitmix
' dependencies are not necessary for our purposes and can be removed from the dependency tree.Copy algorithm cons:
random
does not automatically benefit from updates tosplitmix
. However, note that the algorithm is now stable - the last change to the PRNG itself occurred in May 2018: Bug in splitmix haskellari/splitmix#9.The text was updated successfully, but these errors were encountered: