[Haskell-cafe] Re: Foldr tutorial, Inspired by Getting a Fix from a Fold

apfelmus at quantentunnel.de apfelmus at quantentunnel.de
Mon Feb 12 17:07:12 EST 2007


Bernie Pope wrote:
> Lennart Augustsson wrote:
>> Sure, but we also have
>>
>> para f e xs = snd $ foldr (\ x ~(xs, y) -> (x:xs, f x xs y)) ([], e) xs
> Nice one.

"Nice one" is an euphemism, it's exactly solution one :)

Regards,
apfelmus



More information about the Haskell-Cafe mailing list