Re: [isabelle] No tail-recursive code equation for List.map



Dear all,

> when I export list-based code to Scala and run it on huge inputs, it
> always gives me a StackOverflowException. Looking at the stack trace
> and providing the following tail-recursive version of map, everything
> works fine.

I had similar problems when processing large files using generated
code for Scala, where I did exactly the same as Cornelius did for some
similar function to map.

However, this optimization is clearly language-dependent, because
in Haskell I don't want to have the tail-recursive version, e.g.
consider the call 

take 5 (filter f (map g long_list))

So, if there will be a tail-recursive code equation for List.map in
the default library, please only activate it on languages which
really profit from tail-recursion.

Best regards,
René



This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.