- -- where (x, y) = position
- -- (dx, dy) = (delta direction)
- -- p' = (x + (d * dx), y + (d * dy))
-
-actW ShipW{..} (N d) = ShipW { waypoint = dDelta d North waypoint, ..}
-actW ShipW{..} (S d) = ShipW { waypoint = dDelta d South waypoint, ..}
-actW ShipW{..} (W d) = ShipW { waypoint = dDelta d West waypoint, ..}
-actW ShipW{..} (E d) = ShipW { waypoint = dDelta d East waypoint, ..}
-actW ShipW{..} (L a) = ShipW { waypoint = d, ..} where d = (iterate rotL waypoint) !! (a `div` 90)
-actW ShipW{..} (R a) = ShipW { waypoint = d, ..} where d = (iterate rotR waypoint) !! (a `div` 90)
-actW ShipW{..} (F d) = ShipW { positionW = p', ..}
- where (x, y) = positionW
+
+
+actW :: Ship -> Action Int -> Ship
+actW Ship{..} (N d) = Ship { waypoint = dDelta d North waypoint, ..}
+actW Ship{..} (S d) = Ship { waypoint = dDelta d South waypoint, ..}
+actW Ship{..} (W d) = Ship { waypoint = dDelta d West waypoint, ..}
+actW Ship{..} (E d) = Ship { waypoint = dDelta d East waypoint, ..}
+actW Ship{..} (L a) = Ship { waypoint = d, ..} where d = (iterate rotL waypoint) !! (a `div` 90)
+actW Ship{..} (R a) = Ship { waypoint = d, ..} where d = (iterate rotR waypoint) !! (a `div` 90)
+actW Ship{..} (F d) = Ship { position = p', ..}
+ where (x, y) = position