Re: Map is not tail recursive

From: Marc Rouaix (rouaix@my-dejanews.com)
Date: Tue Jan 12 1999 - 13:06:59 MET


To: caml-list@pauillac.inria.fr
Date: Tue, 12 Jan 1999 12:06:59 -0000
From: "Marc Rouaix" <rouaix@my-dejanews.com>
Subject: Re: Map is not tail recursive

I should have added that you can then write a function like this to choose your map function for you.

let general_map fn lst =
  let n = List.length lst in
  if n < 1000 then List.map fn lst
  else jump_map (truncate (sqrt (float n))) fn lst

---
Marc

-----== Sent via Deja News, The Discussion Network ==----- http://www.dejanews.com/ Easy access to 50,000+ discussion forums



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET