locMove :: Location -> LocDistance -> Location
locMove (Location l) (LocDistance d)
  | l' >= 1   = Location $ l' - 1
  | l' < 0    = Location $ l' + 1
  | otherwise = Location l'
  where
    l' = l + d

-- |
-- Distance between two locations, always in [-0.5, 0.5].
locMove :: Location -> LocDistance -> Location
locMove (Location l) (LocDistance d)
  | l' >= 1   = Location $ l' - 1
  | l' < 0    = Location $ l' + 1
  | otherwise = Location l'
  where
    l' = l + d

-- |
-- Distance between two locations, always in [-0.5, 0.5].
locMove (Location l) (LocDistance d)
  | l' >= 1   = Location $ l' - 1
  | l' < 0    = Location $ l' + 1
  | otherwise = Location l'
  where
    l' = l + d

-- |
-- Distance between two locations, always in [-0.5, 0.5].