Question: Please code in OCaml and NOT using list library methods. This code should only be using standard library methods. partition p lst - Type: ('

 Please code in OCaml and NOT using list library methods. This

Please code in OCaml and NOT using list library methods. This code should only be using standard library methods.

partition p lst - Type: (' a bool) 'a list 'a list 'a list - Description: Returns a tuple of lists (11,12), where 11 is a list of all elements in 1 st that satisfy the predicate p, and 12 is a list of all elements in lst that don't satisfy the predicate p. - Examples: partition is_prime [1;2;3;4;5]=([2;3;5],[1;4]) partition is_prime [10;12;14]=([],[10;12;14]) partition is_even [1;2;3;4;5]=([2;4],[1;3;5])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!