[Haskell-cafe] compare lengths of lists lazily

Henning Thielemann lemming at henning-thielemann.de
Mon Dec 19 16:29:46 CET 2011


Shortest and most obfuscating solution I found is:


import Data.Ord (comparing)
import Control.Applicative ((<$))

compareLength :: [a] -> [a] -> Ordering
compareLength = comparing (()<$)

:-)



More information about the Haskell-Cafe mailing list