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-01-30 03:36 pm (UTC)
From: [identity profile] nivanych.livejournal.com
Зато более универсально.
Это самое takeNth может ещё где-то потребоваться.

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. 4th, 2025 09:02 am
Powered by Dreamwidth Studios