newbie Q: [a] -> [[a]]

Tomasz Zielonka t.zielonka@students.mimuw.edu.pl
Mon, 7 Apr 2003 09:22:16 +0200


On Mon, Apr 07, 2003 at 08:20:29AM +0200, Markus.Schnell@infineon.com wrote:
> (1) Have a look at take 
> (2) Have a look at break and span 
> 
> > Now how generalize this to club 'n' chars instead of two ?
> >   3 -> "abcdefgh" -> ["abc","def","gh"]
> >   i.e. n -> [Char] -> [ [Char] ]  -- all except last element 
> >                                   have length == n

(3) Have a look at splitAt and List.unfoldr (and maybe null)

Regards,
Tom

-- 
.signature: Too many levels of symbolic links