pairs :: LL.ListLike l e => l -> [(e, e)]
pairs l
  | LL.null l = []
  | otherwise = pairs' [] (LL.head l) (LL.tail l)
  where
    pairs' res e l
      | LL.null l = res
      | otherwise =
        let (e', l') = (LL.head l, LL.tail l)
        in pairs' ((e, e'):res) e' l'
pairs :: LL.ListLike l e => l -> [(e, e)]
pairs l
  | LL.null l = []
  | otherwise = pairs' [] (LL.head l) (LL.tail l)
  where
    pairs' res e l
      | LL.null l = res
      | otherwise =
        let (e', l') = (LL.head l, LL.tail l)
        in pairs' ((e, e'):res) e' l'
pairs l
  | LL.null l = []
  | otherwise = pairs' [] (LL.head l) (LL.tail l)
  where
    pairs' res e l
      | LL.null l = res
      | otherwise =
        let (e', l') = (LL.head l, LL.tail l)
        in pairs' ((e, e'):res) e' l'