Re: [Haskell-cafe] Help understanding a partial application

2007-08-26 Thread Levi Stephen
Ryan Ingram wrote: Just expand out the function composition: Dual . Endo . flip f = (\x -> Dual (Endo (flip f x))) which has the type d -> Dual (Endo c). -- ryan Aha. I didn't get this straight away, but once I looked at the type signature for function composition, it became clear.

Re: [Haskell-cafe] Help understanding a partial application

2007-08-26 Thread Ryan Ingram
Just expand out the function composition: Dual . Endo . flip f = (\x -> Dual (Endo (flip f x))) which has the type d -> Dual (Endo c). -- ryan On 8/26/07, Levi Stephen <[EMAIL PROTECTED]> wrote: > > Hi, > > I was browsing through the source code for Data.Foldable and having > trouble > com

[Haskell-cafe] Help understanding a partial application

2007-08-26 Thread Levi Stephen
Hi, I was browsing through the source code for Data.Foldable and having trouble comprehending it (which was kind of the point of browsing the code, so I could learn something ;) ) I'm looking at foldl foldl :: (c -> d -> c) -> c -> t d -> c foldl f z t = appEndo (getDual (foldMap (Dual . End