MappingTutorial (draft)Higher-order functionsAssociativityDocumentation and user's manualTable of contentsOCaml programs

Associativity

   
 

The  ->  operator is right-associative in type expressions as well as in function definitions.

For instance

int -> char -> string

means

int -> (char -> string)

For instance

function x -> function z -> x + z

means

function x -> (function z -> x + z)

   
 

Function application is left-associative.

For instance, assuming  unary_of_int_add  is bound to the value of  function x -> (function z -> x + z) .

Then:

unary_of_int_add 5 8

means

(unary_of_int_add 5) 8

which can also be written

(unary_of_int_add (5)) (8)


Latest update : October 5, 2006
This document was translated from LaTeX by Hyperlatex 2.5, which is not the latest version of Hyperlatex.

MappingTutorial (draft)Higher-order functionsAssociativityDocumentation and user's manualTable of contentsOCaml programs