Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Note 1: All functions, unless otherwise specified, should be polymorphic (i.e., they should work with any data type). For example, if you are writing a
Note 1: All functions, unless otherwise specified, should be polymorphic (i.e., they should work with any data type). For example, if you are writing a method that should work for lists, the type must be 'a list, and not int list. Note 2: You may not use any functions available in the OCaml library that already solves all or most of the question. For example, OCaml provides a List.rev function, but you may not use that in this section. You should also avoid the higher-order functions List.map, List.fold_left, and List.filter. You can, however, use helper functions that you have defined and written yourself. For example, you can define your own higher-order function called "map", and then use that to solve, say, problem 7. 1. Write a recursive function pow, which takes two integer parameters x and n, and returns xn. Also write a function float_pow, which does the same thing, but for x being a float. You can assume that n is non-negative integer for both functions
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