to_list isn't tail recursive (for whatever reason), try this one:

1
2
3
4
5
6
module LazyList =
    let toListTailRecursive xs =
        let rec loop acc = function
        | LazyList.Cons(x, xs) -> loop (x::acc) xs
        | LazyList.Nil -> acc
        loop [] xs |> List.rev
By on 6/15/2009 12:42 AM ()

to_list isn't tail recursive (for whatever reason)

Thanks, I opened a bug about this. Your suggested code is good.

By on 6/15/2009 8:03 AM ()

Please include to_array as well as that seems to be having the same problem

By on 6/15/2009 11:44 AM ()

yike and thanks.

can this classified as a bug as 50000 is not an unusually large number.

By on 6/15/2009 6:20 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper