Thanks, that's clearer now.

On Tue, Dec 22, 2020 at 12:55 AM Francesco Ariis <fa-ml@ariis.it> wrote:
Hello Lawrence,

Il 21 dicembre 2020 alle 23:59 Lawrence Bottorff ha scritto:
> addThree :: (Num a) => a -> a -> a -> a
> addThree = \x -> \y -> \z -> x + y + z
> […]
>
> But how is the beta reduction happening with addThree?

Should be:

addThree = (\x -> \y -> \z -> x + y + z) 1 2 3
         = (\y -> \z -> 1 + y + z) 2 3              beta
         = (\z -> 1 + 2 + z) 3                      beta
         = 1 + 2 + 3                                beta
         = …

Does that make sense?
—F
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners