view 98076 @ 4617:5c4e976f1c2a

<oerjan> addquote <oerjan> in that thread Taneb admits to his sins. i know this because that comment showed up in my friends list <Taneb> oerjan, today I pushed 217 lines of documentation into lens [...] <edwardk> Say 10 Hail Marys and make 3 more lens commits and your sins shall be forgiven.
author HackBot
date Fri, 25 Apr 2014 22:59:42 +0000
parents b70362a4c382
children
line wrap: on
line source

-- 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.