Question: Write a curried F# function cartesian xs ys that takes as input two lists xs and ys and returns a list of pairs that represents

Write a curried F# function cartesian xs ys that takes as input two lists xs and ys and returns a list of pairs that represents the Cartesian product of xs and ys. (The pairs in the Cartesian product may appear in any order.) For example, > cartesian [a:b:c] [1:2:3];: val it:(char * int) list = [(a, 1):(a, 2):(a, 3):(b, 1):(b, 2) (b, 3):(c, 1):(c, 2):(c, 3)]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
