Hi,

Im brand new to Haskell and i'd like to do some ASCI rendering, but i seem to be stuck:
So, i have the following:

Code:
type Figure a = Pos -> a

type Pos = (Double, Double) -- (x, y)

type Dimension = (Int, Int)

toPosition :: Dimension -> (Int, Int) -> Pos
toPosition d (x, y) = (fromIntegral x*2/w-1, 1-fromIntegral y*2/h)
  where
   w  = fromIntegral (fst d-1)
   h  = fromIntegral (snd d-1)

render :: Dimension -> Figure a -> [[a]]
and im stuck at a definition for render
the area between positions is from low left (-1,-1) till upper right (1,1)
so i write :
render (m,n) s = [[toPosition (m,n) s | s <- [-1,1]]]

but it gives me:

Code:
Inferred type is not general enough
*** Expression    : render
*** Expected type : Dimension -> Figure a -> [[a]]
*** Inferred type : Dimension -> Figure (Double,Double) -> [[(Double,Double)]]
I also tried:

Code:
render (m,n) s = map(toPosition (m,n) s) [-1..1]
But then it says :
Code:
Type error in application
*** Expression     : toPosition (m,n) s
*** Term           : s
*** Type           : (Double,Double) -> a
*** Does not match : (Int,Int)
So there's obviously something i don't understand. Could someone help along please?