On Thu, Sep 20, 2007 at 04:17:54AM +0100, PR Stanley wrote:
> Hi
> length = foldr (. n . 1 + n) 0
> Any idea how to define length with foldr. The above definition doesn't make 
> much sense.
> Many thanks, Paul

length = foldr (λ_ n → 1 + n) 0

or, in ASCII concrete syntax

length = foldr (\_ n -> 1 + n) 0

Stefan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to