a splitting function, split_by
Write a splitting function named split_by that takes threearguments
an equality checking function that takes two values and returnsa value of type bool,
a list of values that are to be separated,
and a list of separators values.
This function will split the second list into a list of lists.If the checking function indicates that an element of the firstlist (the second argument) is an element of the second list (thethird argument) then that element indicates that the list should besplit at that point. Note that this \"splitting element\" does notappear in any list in the output list of lists.
For example,
split_by (=) [1;2;3;4;5;6;7;8;9;10;11] [3;7] should evaluate to[ [1;2]; [4;5;6]; [8;9;10;11] ] and
split_by (=) [1;2;3;3;3;4;5;6;7;7;7;8;9;10;11] [3;7] shouldevaluate to [[1; 2]; []; []; [4; 5; 6]; []; []; [8; 9; 10;11]].
Note the empty lists. These are the list that occur between the3's and 7's.
split_by (=) [\"A\"; \"B\"; \"C\"; \"D\"] [\"E\"] should evaluate to[[\"A\"; \"B\"; \"C\"; \"D\"]]
Annotate your function with types.
Also add a comment explaining the behavior of your function andits type. Try to write this function so that the type is as generalas possible.
OCaml code without using rec keyword in it.