Lambda calc version of Haskell lambda function

Here is a function declaration makeAddress :: Int -> String -> String -> (Int, String, String) makeAddress number street town = (number,street,town) and here is a lambda function version makeAddressLambda = (\number -> (\street -> (\town -> (number, street, town)))) How would this lambda version look in lambda calculus? Like this? \number.\street.\town.(number street town) then (\number.\street.\town.(number street town) (123 "Sunny St." "Fergus") (\street.\town.(123 street town) ("Sunny St." "Fergus") (\town.(123 "Sunny St.") ("Fergus") (123 "Sunny St." "Fergus") Not always sure. LB

Il 31 dicembre 2020 alle 22:33 Lawrence Bottorff ha scritto:
Here is a function declaration
makeAddress :: Int -> String -> String -> (Int, String, String) makeAddress number street town = (number,street,town)
and here is a lambda function version
makeAddressLambda = (\number -> (\street -> (\town -> (number, street, town))))
You can lose most of the parentheses: makeAddressLambda = \number -> \street -> \town -> (number, street, town)
How would this lambda version look in lambda calculus? Like this?
\number.\street.\town.(number street town)
Yes.
then
(\number.\street.\town.(number street town) (123 "Sunny St." "Fergus")
Wait! You have lost a ‘)’ on the lambdas (remember λ goes as far right as possible). Also (123, "Sunny St.", "Fergus") makes it look like it is a single argument, which leads to a wrong result: (λnumber. λstreet. λtown. number street town) (123, "Sunny St.", "Fergus") λstreet. λtown. (123, "Sunny St.", "Fergus") street town -- woops! Instead, keeping in mind Haskell follows a beta-nu-mu strategy, we have a series of 3 βs: (λnumber. λstreet. λtown. (number, street, town)) 123 "Sunny St." "Fergus" (λstreet. λtown. (123, street, town) "Sunny St." "Fergus" (λtown. (123, "Sunny St.", town) "Fergus" (123, "Sunny St.", "Fergus")
participants (2)
-
Francesco Ariis
-
Lawrence Bottorff