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

Good idea re: Arrows, and we can go all out as long as we're using them. :-)

rle = group >>> map (length &&& head)

And stream fusion should get rid of intermediate data structures.