[Haskell-beginners] reverse [1..]

Felipe Almeida Lessa felipe.lessa at gmail.com
Tue Dec 18 16:13:13 CET 2012


If you don't care about the order, you may use:

allNumbers = 0 : merge [1,2..] [-1,-2..]
  where merge (x:xs) ys = x : merge ys xs

Cheers,

On Tue, Dec 18, 2012 at 12:35 PM, Emanuel Koczwara
<poczta at emanuelkoczwara.pl> wrote:
> Hi,
>
> Dnia 2012-12-18, wto o godzinie 20:30 +0600, Alexander _ pisze:
>> Hello,
>>
>>
>>
>> Here you try to reverse infinite list. What do you expect to get?
>>
>
>   I was trying to build infinite list from -inf to +inf.
>
> Emanuel
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



-- 
Felipe.



More information about the Beginners mailing list