datatype direction = North | South | East | West; fun turnRight North = East | turnRight East = South | turnRight South = West | turnRight West = North; fun turnLeft North = West | turnLeft West = South | turnLeft South = East | turnLeft East = North; fun isVerticalDirection North = true | isVerticalDirection South = true | isVerticalDirection x = false; (* i.e. East or West *)