I'm currently working on a program in Haskell (which I am very new to) where I need to randomly generate co-ordinates and use them around the program in several places, however, I don't want to be threading IO around the whole program, nor the seed. I saw this link where they use num <- randomIO :: IO Float
however I keep getting - Couldn't match type `IO' with `[]' Expected type: [Float]
. I in theory need the co-ordinates to be integer values, so if there is a better way of doing it that would be great! The full stack is below:
Couldn't match type `IO' with `[]'
Expected type: [Float]
Actual type: IO Float
* In a stmt of a 'do' block: y <- randomIO :: IO Float
An example of the code that is causing an error.
import Data.List
import System.Random
someF :: [[Char]]
someF = do
ytemp <- randomIO :: IO Float
[]