Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Map is not tail recursive
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marc Rouaix <rouaix@m...>
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