Re: about labels

Florent Monnier <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <CAE1DttBJY47c9cqt_gA4tW9Dc-TN57A6c__Eb0Fo-UvNsHPcXw@mail.gmail.com>
On 2014/01/07, Gabriel Scherer wrote:
> Yes ! A label ~foo without the value always mean ~foo:foo, just like in a
> record, { x; y = ... } means { x = x; y = ... }.

This is also useful to understand why sometimes the labeled functions,
and their equivalent without, are provided separately in two different
modules.

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

# ListLabels.fold_left ;;
- : f:('a -> 'b -> 'a) -> init:'a -> 'b list -> 'a = <fun>

-- 
Florent
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.