[Haskell-beginners] Merge Sort Stack Overflow

Chaddaï Fouché chaddai.fouche at gmail.com
Mon Sep 16 21:33:16 CEST 2013


Le 16 sept. 2013 19:35, "Florian Lammel" <mail at florianlammel.com> a écrit :
> splitInHalf :: [a] -> ([a], [a])
> splitInHalf [] = ([], [])
> splitInHalf [x] = ([x], [])
> splitInHalf (x:y:xys) = (x:xs, y:ys)
>     where (xs, ys) = splitInHalf xys

Try the following :

>    where ~(xs, ys) = splitInHalf xys

And let us know if that help.
-- 
Chaddaï
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130916/d2e2c2d2/attachment.htm>


More information about the Beginners mailing list