# HG changeset patch # User HackBot # Date 1389066428 0 # Node ID b70362a4c3825508ca1db6f16f57f5f4e84aaf3e # Parent 383e29aa08f47e8bf1fcf9bdd8494d5a705e0dcf fetch http://lpaste.net/raw/98076 diff -r 383e29aa08f4 -r b70362a4c382 98076 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/98076 Tue Jan 07 03:47:08 2014 +0000 @@ -0,0 +1,9 @@ +-- Hi everyone! +-- Could please someone explain me an output of the function: + +splitEvery n list = first : ( splitEvery n rest ) + where (first, rest) = splitAt n list + +-- it returns a lis of lists splitEvery :: Int -> [a] -> [[a]] +-- But I don't understand how it works, why it returns list of lists. +-- splitAt returns TUPLE and "first" is somehow joined to it. \ No newline at end of file