juan_gandhi: (Default)
[personal profile] juan_gandhi

pairwise :: [a] →  [(a, a)]
pairwise [] = []
pairwise (x:y:rest) = (x,y) : pairwise rest

is there something that does it already? Could not figure out.

Date: 2010-02-01 12:12 am (UTC)
From: [identity profile] ivan-gandhi.livejournal.com
Вот! Не слыхал про unfold раньше, но это то, что должно было вертеться на языке.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

December 2025

S M T W T F S
  12 3456
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 3rd, 2025 11:50 pm
Powered by Dreamwidth Studios