Question: 2, write an F# function elen: int-> ilist-> int which takes a positive integer n and a list , and returns the nth element of
2, write an F# function elen: int-> ilist-> int which takes a positive integer n and a list , and returns the nth element of if the list has at least n elements, and fails (using failwith) with message "Index out of bound" otherwise. For example, elem 2 (L(3, L(21, L(11, E)))) is 21 3. Write an F# function isin: int-> int list-> bool which takes an integer x and a list l and returns true if and only if r occurs in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
