-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help/advice upgrading MonadRandom
to 1.3.0?
#179
Comments
In your particular case there are two ways that it can be solved I believe:
newtype PureRandGen g = PureRandGen g
instance FrozenGen (PureRandGen g) (RandT g m) where
type MutableGen (PureRandGen g) (RandT g m) = RandGen g
freezeGen = _
overwriteGen = _ This is because we decided early on in the If you look into Let me know if it is not clear and I could try to find some time and submit a PR into |
Looks like this has been resolved in byorgey/MonadRandom#55 |
Trying to build the
MonadRandom
package withrandom-1.3
fails with the following compilation error (see byorgey/MonadRandom#54):It seems this is a type error in some generic auto-generated code for
uniformByteArrayM
, which was added to theStatefulGen
class in 1.3. Looking at thedefault
type signature foruniformByteArrayM
(here: https://hackage.haskell.org/package/random-1.3.0/docs/src/System.Random.Internal.html#uniformByteArrayM), we see this:I think I see how this is supposed to work:
MutableGen
has a functional dependency from its output to its first parameter, sog ~ MutableGen f m
should be enough to fixf
. The problem is really that we don't have aFrozenGen g (RandT g m)
instance. After carrying out a bunch of type substitutions, I am pretty sure the instance I want looks something like this:However, this fails because it overlaps with an instance in
System.Random.Internal
!So now I am at a bit of a loss how to proceed. Any advice, pointing out something I am doing wrong, etc. would be very welcome!
The text was updated successfully, but these errors were encountered: