Y
Hacker News
new
|
ask
|
show
|
jobs
by
brehaut
5578 days ago
You can replace (\x -> (length x, head x)) with (length &&& head) if you import Control.Arrow to make it fully point free
2 comments
jamwt
5577 days ago
Good idea re: Arrows, and we can go all out as long as we're using them. :-)
rle = group >>> map (length &&& head)
link
eru
5577 days ago
And stream fusion should get rid of intermediate data structures.
link
rle = group >>> map (length &&& head)