[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] compare lengths of lists lazily
From:       Alexey Khudyakov <alexey.skladnoy () gmail ! com>
Date:       2011-12-19 16:34:42
Message-ID: 4EEF67A2.4080004 () gmail ! com
[Download RAW message or body]

On 19.12.2011 19:29, Henning Thielemann wrote:
>
> Shortest and most obfuscating solution I found is:
>
>
> import Data.Ord (comparing)
> import Control.Applicative ((<$))
>
> compareLength :: [a] -> [a] -> Ordering
> compareLength = comparing (()<$)
>
comparingLength = comparing void

It's two character shorter

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic