Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Syntax for label
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: Syntax for label, NEW PROPOSAL
> >         Objective Caml version 2.99+10
> > 
> > # let sum l = List.fold_right ( + ) l 0;;
> >                               ^^^^^
> > This expression has type int -> int -> int but is here used with type 'a list
> 
> Is this not because the new definition of List.fold_right wants the list
> first, and then only the function ?

Unfortunately no: List.fold_right expects its arguments as usual:

latour:~ ocaml -modern
        Objective Caml version 2.99+10

# List.fold_right;;
- : fun:('a -> acc:'b -> 'b) -> 'a list -> acc:'b -> 'b = <fun>

Friendly,
-- 
Pierre Weis

INRIA, Projet Cristal, http://pauillac.inria.fr/~weis