gameLoop :: Member (State GameState) e => Action -> Eff e RoundResult
gameLoop (Go dir) = do
    gs <- get
    let direction = actionToDirection dir
        thePlayer = player gs
        theBoard = board gs
    when (canPlayerMove direction theBoard thePlayer) $ modify $ \st ->
        let (newPos, newBoard) = move direction (position thePlayer) theBoard
        in st { board = newBoard, player = thePlayer {position = newPos}}
    return Continue
    where actionToDirection North = north
          actionToDirection South = south
          actionToDirection West = west
          actionToDirection East = east
gameLoop :: Member (State GameState) e => Action -> Eff e RoundResult
gameLoop (Go dir) = do
    gs <- get
    let direction = actionToDirection dir
        thePlayer = player gs
        theBoard = board gs
    when (canPlayerMove direction theBoard thePlayer) $ modify $ \st ->
        let (newPos, newBoard) = move direction (position thePlayer) theBoard
        in st { board = newBoard, player = thePlayer {position = newPos}}
    return Continue
    where actionToDirection North = north
          actionToDirection South = south
          actionToDirection West = west
          actionToDirection East = east
gameLoop (Go dir) = do
    gs <- get
    let direction = actionToDirection dir
        thePlayer = player gs
        theBoard = board gs
    when (canPlayerMove direction theBoard thePlayer) $ modify $ \st ->
        let (newPos, newBoard) = move direction (position thePlayer) theBoard
        in st { board = newBoard, player = thePlayer {position = newPos}}
    return Continue
    where actionToDirection North = north
          actionToDirection South = south
          actionToDirection West = west
          actionToDirection East = east