[Haskell-cafe] Removing alternate items from a list
tphyahoo at gmail.com
Mon Jun 7 14:42:39 EDT 2010
map snd . filter (odd . fst) . zip [1,2..] $ [1,2,3,4,5]
2010/6/6 R J <rj248842 at hotmail.com>:
> What's the cleanest definition for a function f :: [a] -> [a] that takes a
> list and returns the same list, with alternate items removed? e.g., f [0,
> 1, 2, 3, 4, 5] = [1,3,5]?
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
> Get started.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe