lookup :: Int -> Queue a -> a
lookup i (Q lenf f _ lenr r) = if i < lenf
  then L.lookup i f
  else L.lookup (lenr - (i - lenf) - 1) r
lookup :: Int -> Queue a -> a
lookup i (Q lenf f _ lenr r) = if i < lenf
  then L.lookup i f
  else L.lookup (lenr - (i - lenf) - 1) r
lookup i (Q lenf f _ lenr r) = if i < lenf
  then L.lookup i f
  else L.lookup (lenr - (i - lenf) - 1) r