Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the types of the following expressions (OCaml). Assume that addition (+) operates on integers(int)). map(x.1 +x) [1; 2; 3] [(x.x+ 1); (x.x+ 2)] map(f.f1)
Write the types of the following expressions (OCaml). Assume that addition (+) operates on integers(int)).
map(x.1 +x) [1; 2; 3]
[(x.x+ 1); (x.x+ 2)]
map(f.f1) [(x.x+ 1); (x.x+ 2)]
map(f.y.f(y+ 1)) [(x.x+ 1); (x.x+ 2)]
fold-left(x y.ifythen1 +xelsex) 0 [true;false;true]
(f x.f x) (x.x+ 1) 2
fold-right(f x.f x) 0 [(x.x+ 1); (x.x+ 2)]
(f g.x.f(g x)) (x.x+ 2) (x.x)
fold-right(f g.x.f(g x)) (x.x) [(x.x+ 1); (x.x+ 2)]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started