Written by Isaiah Oloyede
on
Chapter 1: All You Need is Lambda
This note captures my solutions to exercises in Chapter 1: All You Need is Lambda of the book Haskell programming from first principles
Intermission: Equivalence Exercises
λxy.xz is equivalent to (b) λmn.mz.
λxy.xxy is equivalent to (c) λa.(λb.aab).
λxyz.zx is equivalent to (b) λtos.st.
Combinators Exercise
λx.xxx is a combinator.
λxy.zx is not a combinator because z is a free variable.
λxyz.xy(zx) is a combinator.
λxyz.xy(zxy) is a combinator.
λxy.xy(zxy) is not a combinator because z is a free variable.
λx.xxx is a normal form.
(λz.zz)(λy.yy) diverges.
(λx.xxx)z can be reduced to the normal form, zzz.
Beta reduce
(λabc.cba)zz(λwv.w) reduces to z.
(λx.λy.xyy)(λa.a)b reduces to bb.
(λy.y)(λx.xx)(λz.zq) reduces to qq.
(λz.z)(λz.zz)(λz.zy) reduces to yy.
(λx.λy.xyy)(λy.y)y reduces to yy.
(λa.aa)(λb.ba)c reduces to aac.
(λxyz.xz(yz))(λx.z)(λx.a) reduces to (λz1.za).
Since the book has solutions for the chapter exercises, refer to Haskell programming from first principles for detailed solutions.