[Haskell-beginners] Another currying and lambda question
borgauf at gmail.com
Tue Dec 22 21:15:42 UTC 2020
On Tue, Dec 22, 2020 at 11:59 AM Francesco Ariis <fa-ml at ariis.it> wrote:
> Il 22 dicembre 2020 alle 11:48 Lawrence Bottorff ha scritto:
> > flipA :: (a -> b -> c) -> b -> a -> c
> > flipA f x y = f y x
> > What is it specifically about currying that makes flipA possible?
> I do not see how currying is involved here! Maybe when you pass
> a function to an higher order one?
> > flipB :: (a -> b -> c) -> b -> a -> c
> > flipB f = \x y -> f y x
> > Also, with flipB, could someone explain the beta reduction? It looks
> > like f is not being acted on, just passed along, Would it look more
> > like this in lambda calculus?
> Indeed `f` is not being acted on (i.e. it is «outside» of the lambda)
> (λx. λy. f y x) b a
> (λy. f y b) a beta
> f a b beta
> fully expressed with lambdas would be:
> (λf. λx. λy. f y x) g b a
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners