codeworld icon indicating copy to clipboard operation
codeworld copied to clipboard

User-reported unhelpful error message

Open codeworld-feedback opened this issue 6 months ago • 0 comments

Program: https://code.world/haskell#P5oVFun2DhRjp5x0v_ATOfA

Message:

program.hs:47:44-52: error:
    • Couldn't match type ‘World -> World’ with ‘Picture’
      Expected type: World -> Picture
        Actual type: Double -> World -> World
    • Probable cause: ‘stepWorld’ is applied to too few arguments
      In the third argument of ‘activityOf’, namely ‘stepWorld’
      In the expression:
        activityOf worldInicial handleEvent stepWorld drawWorld
      In an equation for ‘main’:
          main
            = activityOf worldInicial handleEvent stepWorld drawWorld
            where
                xs = randomRs (- 6, 6) (mkStdGen 42) :: [Double]
                vs = randomRs (velMin, velMax) (mkStdGen 99) :: [Double]
                bolasTodas = zipWith (\ x v -> Ball (x, 9) v) xs vs
                iniciais = take bolasSimultaneas bolasTodas
                ....

codeworld-feedback avatar Sep 01 '25 19:09 codeworld-feedback