<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hello, <br><br>I have made a exercise where I must split a even list.<br>The answer is :<br><br>halve xs = (take n xs&nbsp; drop n xs) <br>&nbsp;&nbsp;&nbsp;&nbsp; where n = length xs 'div' 2 <br><br>Now I want to change it so i can split even and not even list,.<br>I thought this can be the answer <br><br>halve xs = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lenght xs 'mod' 2 = 0&nbsp; : (take n&nbsp; xs&nbsp;&nbsp; drop n xs) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; otherwise :&nbsp; (take n+1 xs&nbsp; drop n+1 xs) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n = length xs 'div' 2 <br><br><br>Can this be working ?<br>I did not check this on GCHI because Im&nbsp; re - installing my OS.<br><br>Regards. <br><br>Roelof<br><br>                                               </div></body>
</html>