Question: F# programming using combinators. 1 Programming with Combinators In this part you will practice with using higher-order combinators in F#. In defining the functions below,
F# programming using combinators.

1 Programming with Combinators In this part you will practice with using higher-order combinators in F#. In defining the functions below, you may not use recursion or any of the library functions from F#'s List module, except for the list constructors: and CJ. Instead, for each question you can use as necessary the com binators provided in Hu5/combinators.fsx and your own non-recursive helper functions, such as anonymous functions. Define each function below and provide the definition in combinators.fsx. 1. vsum : (float loat) list->float float such that for all 20 2. length 'a list - int, which computes the length of its input list. 3. llength 'a list list -int list such that, for every k20 (length i:.)i..n where n is the length of the list 4 for each i-k remove 'a-'a list -> 'a list) when 'a: equality, which takes a value of type 'a and an 'a list Iand "removes" every occurrence of v from l, if any . 1min'a 1ist -> 'a, which retuns an error message (using failwith) if its input 1 is empty and otherwise returns the smallest element of 1 according to the ('a list bool) when 'a equality, where (isIn a D is true if r occurs in I, and is false otherwise. 7. leven int list -> bool, which returns true for lists consisting of even integers, and return false otherwise. For example, (leven [2; 4; 0; -8 2) is true while (leven [2; 1; 2; -12]) is false 8. [Optional, extra credit] append 'a list - 'a list ->'a list, which behaves like the append operator Q, that is, takes two lists of the same type and returns their concatenation 1 Programming with Combinators In this part you will practice with using higher-order combinators in F#. In defining the functions below, you may not use recursion or any of the library functions from F#'s List module, except for the list constructors: and CJ. Instead, for each question you can use as necessary the com binators provided in Hu5/combinators.fsx and your own non-recursive helper functions, such as anonymous functions. Define each function below and provide the definition in combinators.fsx. 1. vsum : (float loat) list->float float such that for all 20 2. length 'a list - int, which computes the length of its input list. 3. llength 'a list list -int list such that, for every k20 (length i:.)i..n where n is the length of the list 4 for each i-k remove 'a-'a list -> 'a list) when 'a: equality, which takes a value of type 'a and an 'a list Iand "removes" every occurrence of v from l, if any . 1min'a 1ist -> 'a, which retuns an error message (using failwith) if its input 1 is empty and otherwise returns the smallest element of 1 according to the ('a list bool) when 'a equality, where (isIn a D is true if r occurs in I, and is false otherwise. 7. leven int list -> bool, which returns true for lists consisting of even integers, and return false otherwise. For example, (leven [2; 4; 0; -8 2) is true while (leven [2; 1; 2; -12]) is false 8. [Optional, extra credit] append 'a list - 'a list ->'a list, which behaves like the append operator Q, that is, takes two lists of the same type and returns their concatenation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
