lambdabot/dice

Can't build with random-fu 0.3

Opened this issue · 0 comments

l29ah commented
[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)
    |                                                ^^^^^^^^^^^^^^^^^^^^^^^