
20 May
2007
20 May
'07
9:23 a.m.
geniusfat wrote:
hi dear haskell lover ;) what I want to do is simply this: select3 :: [a] -> [(a, a, a)] and how can it be done efficiently? thanks in advance!
What, as in select3 [1..10] -> [(1,2,3),(2,3,4),(3,4,5),(4,5,6),(5,6,7),(6,7,8),(7,8,9),(8,9,10)] ? How about like this: select3 = map (\[x,y,z] -> (x,y,z)) . filter ((2 <) . length) . take 3 . tails