How are ListLabels, ArrayLabels, etc. implemented?

Thanks for the feedback Nicolas.

IMO, labeling a parameter when it there is no ambiguity, like f in map, is not very useful.

But it’s pretty nice to have labeled arguments when several arguments have the same type.

# Array.sub;;
- : 'a array -> int -> int -> 'a array = <fun>
# ArrayLabels.sub;;
- : 'a array -> pos:int -> len:int -> 'a array = <fun>

Ideally, Array.sub would be labeled.

4 Likes