Jane St Core uses labeled arguments to avoid this issue, worth considering if you can.

On Nov 28, 2012 5:18 PM, "Lukasz Stafiniak" <lukstafi@gmail.com> wrote:
I have this problem too. Look _very closely_ at List.fold_left and
List.fold_right. Hashtbl.fold should pretend to be like
List.fold_left, because it is not supposed to preserve the structure
of the underlying data structure in its computation, and it should be
tail-recursive.

On Wed, Nov 28, 2012 at 5:40 AM, William Smith <bills@wwayneb.com> wrote:
> List.fold_left expects the List as the 3rd parameter with the second
> parameter being the initial value.
>
> Hashtbl.fold expects the Hasthbl as the second parameter with the 3rd
> parameter being the initial value... just the opposite of List.fold_left.
>
> Is there a reason for this difference?   I'm having trouble remembering
> which goes which way.   If it's not a historical accident, I'd like to have
> a understanding of why they are different to help me know which is which.
>
> Thanks,
>
> Bill

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs