I am new to Haskell and I'm trying to change the position of a drawn path.
let redPath = Path[Point 420 750, Point 420 550] red Solid
drawPicture 10 [redPath, movePictureObject (Vector 100 100)
redPath]
The functions movePictureObject and movePoint should change every point of the path with a given vector (100,100).
movePoint :: Point -> Vector -> Point
movePoint (Point x y) (Vector xv yv)
= Point (x + xv) (y + yv)
movePictureObject :: Vector -> PictureObject ->PictureObject
movePictureObject vec (Path points colour lineStyle)
= Path map (movePoint (points vec)) red Solid
I am not sure of how to use the map function properly, I have read several posts here and watched other tutorials.
Thank you.
Path? What isPoint? What is aPictureObject? What isVector? Why is this tagged dictionary? And what is your actual question?