Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 fn lst
  else jump_map (truncate (sqrt (float n))) fn lst


-----== Sent via Deja News, The Discussion Network ==-----  Easy access to 50,000+ discussion forums