1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | probando :: ST s ( STArray s (Int,Int) Char) -> (Int, Int) -> [[Char]] probando tab pos = do let w = runSTArray tab if noValidM w pos then return [] else do dir <- "ldru" guard ( isValidM pos w dir ) let (pos',tab') = (mov dir pos w, act tab pos pos') y <- ( probando tab' pos') return (dir : y) noValidM :: Array (Int, Int) Char -> (Int, Int) -> Bool isValidP :: (Int,Int) -> Array (Int,Int) Char -> Bool mov :: Char -> (Int, Int) -> Array (Int, Int) Char -> (Int, Int) {- STArray.hs:110:22: Couldn't match type `s' with `s1' `s' is a rigid type variable bound by the type signature for probando :: ST s (STArray s (Int, Int) Char) -> (Int, Int) -> [[Char]] at STArray.hs:109:1 `s1' is a rigid type variable bound by a type expected by the context: ST s1 (STArray s1 (Int, Int) Char) at STArray.hs:110:11 Expected type: ST s1 (STArray s1 (Int, Int) Char) Actual type: ST s (STArray s (Int, Int) Char) In the first argument of `runSTArray', namely `tab' In the expression: runSTArray tab -} |
1:13: Warning: Use String
Found:
ST s (STArray s (Int, Int) Char) -> (Int, Int) -> [[Char]]
Why not:
ST s (STArray s (Int, Int) Char) -> (Int, Int) -> [String]
6:11: Warning: Redundant bracket
Found:
do dir <- "ldru"
guard (isValidM pos w dir)
let (pos', tab') = (mov dir pos w, act tab pos pos')
y <- (probando tab' pos')
return (dir : y)
Why not:
do dir <- "ldru"
guard (isValidM pos w dir)
let (pos', tab') = (mov dir pos w, act tab pos pos')
y <- probando tab' pos'
return (dir : y)