On Mon, Dec 04, 2006 at 07:00:23PM +0000, Joachim Breitner wrote:
> I came up with:
>       \g -> map (\n a -> g a !! n) [1..]
> which has the desired type and functionality, but it looks rather
> inelegant and messy. Any better ideas?

I like

sequence a2bs = (head . a2bs) : sequence (tail . a2bs)

This also makes it explicit that by golly your function had better return
an infinite list, or we're in trouble.
-- 
David Roundy
Department of Physics
Oregon State University
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to