1. Engineering
  2. Computer Science
  3. how to write a haskell function splitit that takes a...

Question: how to write a haskell function splitit that takes a...

Question details

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

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution