Do note that if you force it so that it the value needs the last element, it will be stuck in an infinite loop of request-> response loop. Here's what will happen/ last [3,5 ..] -- Same thing as your function This will be forced to last [3,5, 7 ..] which will be forced till it terminates (which is never). So, be careful with that. However, things like this are perfectly fine. head [3,5 ..] yields 3 takeWhile (<10) [3,5 ..] yields [3,5,7,9] On Mon, Aug 17, 2015 at 12:05 PM, akash g <akaberto@gmail.com> wrote:
Not a problem. And I should have thought about what you wanted too.
This version will give you an infinite list of odd numbers from 3.
On Mon, Aug 17, 2015 at 12:02 PM, Debdut Karmakar <debdutk@gnulinuxed.tk> wrote:
Sorry, I wrote a wrong function, the correct version is:
oddsFrom3 :: [Integer] oddsFrom3 = 3 : map (+2) oddsFrom3 --
A* GNU <http://gnu.org> Linux <http://www.linuxfoundation.org/>* Patron
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners