locDist :: Location -> Location -> LocDistance
locDist ll1@(Location l1) ll2@(Location l2) = LocDistance $ f * (min d (1 - d)) where
  d = if l1 > l2 then l1 - l2 else l2 - l1
  f = if ll1 `rightOf` ll2 then 1 else (-1)
locDist :: Location -> Location -> LocDistance
locDist ll1@(Location l1) ll2@(Location l2) = LocDistance $ f * (min d (1 - d)) where
  d = if l1 > l2 then l1 - l2 else l2 - l1
  f = if ll1 `rightOf` ll2 then 1 else (-1)
locDist ll1@(Location l1) ll2@(Location l2) = LocDistance $ f * (min d (1 - d)) where
  d = if l1 > l2 then l1 - l2 else l2 - l1
  f = if ll1 `rightOf` ll2 then 1 else (-1)