parts

5 views
Skip to first unread message

Aycan iRiCAN

unread,
Aug 16, 2007, 5:01:15 PM8/16/07
to zekUs, core-h...@googlegroups.com
Selam,

Dosyadaki satırları N'e bölen bişey sormuştun, hemen kaçtın kanaldan.
Ben de eve servis yapayım dedim :)

parts n = takeWhile (not . null) . unfoldr (Just . splitAt n)

*Main> parts 3 (lines "abc\nde\nfg\nhi\njk\nlm\nlo")
[["abc","de","fg"],["hi","jk","lm"],["lo"]]

Sevgiler...

[1] http://www.haskell.org/haskellwiki/Blow_your_mind
--
aycan

Reply all
Reply to author
Forward
0 new messages