Question
Using library functions, define a function halve :: [a] $\rightarrow([a],[a])$ that splits an even-lengthed list into two halves. For example:$$\begin{aligned}& >\text { halve }[1,2,3,4,5,6] \\& ([1,2,3],[4,5,6])\end{aligned}$$
Step 1
We can use the `length` function from the `Data.List` module to do this. Show more…
Show all steps
Your feedback will help us improve your experience
Watch the video solution with this free unlock.
EMAIL
PASSWORD