I’m encountering a baffling type error involving the following function:
roll :: Int -> Int -> (List Int -> Int) -> Effect Int
roll m n s = s <$> (sequence $ replicate n $ randomInt 1 m)
the error is
Could not match type
List
with type
List
while trying to match type List Int
with type List Int
while checking that expression (apply sequence) ((apply (replicate n)) ((randomInt 1) m))
has type t0 (List Int)
in value declaration roll
where t0 is an unknown type
when I remove the type signature and check the type, it’s
forall a. Int -> Int -> (List Int -> a) -> Effect a
Am I not allowed to specify the type further?