packages feed

cabal-gild-0.3.0.0: source/library/CabalGild/Extra/List.hs

module CabalGild.Extra.List where

compareLength :: [a] -> Int -> Ordering
compareLength xs n =
  if n < 0
    then GT
    else case xs of
      [] -> compare 0 n
      _ : ys -> compareLength ys $ n - 1