Question: How to write a Haskell function splitit that takes a list of any type, split it in half, and return the two halves in a
How to write a Haskell function splitit that takes a list of any type, split it in half, and return the two halves in a new list. If there are an odd number of elements, the first half is to be the smaller one. This implies that if there is only one element, the first list of the two should be empty. If the input is the empty list, the output list should contain a pair of empty lists. The input list can contain any type of element, including numbers, characters, strings, lists, etc.
PLZ HELP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
