Skip to content
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

Can't build with random-fu 0.3 #3

Open
l29ah opened this issue Aug 1, 2022 · 0 comments
Open

Can't build with random-fu 0.3 #3

l29ah opened this issue Aug 1, 2022 · 0 comments

Comments

@l29ah
Copy link

l29ah commented Aug 1, 2022

[1 of 2] Compiling Data.Random.Dice ( src/Data/Random/Dice.hs, /home/l29ah/projects/dice/dist-newstyle/build/x86_64-linux/ghc-9.0.2/dice-0.1.0.1/build/dice/dice-tmp/Data/Random/Dice.o )

src/Data/Random/Dice.hs:174:15: error:
    • No instance for (mtl-2.2.2:Control.Monad.Reader.Class.MonadReader
                         g0 IO)
        arising from a use of ‘sample’
    • In the first argument of ‘($)’, namely ‘sample’
      In a stmt of a 'do' block:
        ex <- sample $ runExpr ex :: IO (Expr [Integer])
      In the expression:
        do ex <- sample $ runExpr ex :: IO (Expr [Integer])
           return (Right (fmtSimpleRational (fmap (summarizeRollsOver 3) ex)))
    |
174 |         ex <- sample $ runExpr ex :: IO (Expr [Integer])
    |               ^^^^^^

src/Data/Random/Dice.hs:193:48: error:
    • Could not deduce (random-1.2.1.1:System.Random.Internal.UniformRange
                          a)
        arising from a use of ‘integralUniform’
      from the context: Integral a
        bound by the type signature for:
                   roll :: forall a. Integral a => a -> a -> RVar [a]
        at src/Data/Random/Dice.hs:183:1-42
      Possible fix:
        add (random-1.2.1.1:System.Random.Internal.UniformRange
               a) to the context of
          the type signature for:
            roll :: forall a. Integral a => a -> a -> RVar [a]
    • In the second argument of ‘replicateM’, namely
        ‘(integralUniform 1 sides)’
      In a stmt of a 'do' block:
        ls <- replicateM (fromIntegral count) (integralUniform 1 sides)
      In the expression:
        do ls <- replicateM (fromIntegral count) (integralUniform 1 sides)
           return ls
    |
193 |         ls <- replicateM (fromIntegral count) (integralUniform 1 sides)
    |                                                ^^^^^^^^^^^^^^^^^^^^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant