Are you over 18 and want to see adult content?
More Annotations
A complete backup of kapli-personalslim.ru
Are you over 18 and want to see adult content?
A complete backup of xn----7sbqamfrkhj2bc3a.com
Are you over 18 and want to see adult content?
A complete backup of kalmarfogtechnika.hu
Are you over 18 and want to see adult content?
A complete backup of lifewithoutlimbs.org
Are you over 18 and want to see adult content?
A complete backup of reputationisimportant.com
Are you over 18 and want to see adult content?
A complete backup of nadacepartnerstvi.cz
Are you over 18 and want to see adult content?
Favourite Annotations
A complete backup of idolos-frases.tumblr.com
Are you over 18 and want to see adult content?
A complete backup of ticketmates.com.au
Are you over 18 and want to see adult content?
A complete backup of matchmakerforhire.com
Are you over 18 and want to see adult content?
A complete backup of express-kniga.de
Are you over 18 and want to see adult content?
A complete backup of whitefauxtaxidermy.com
Are you over 18 and want to see adult content?
A complete backup of fearless-satisfaction.blogspot.com
Are you over 18 and want to see adult content?
Text
OPTION - OCAML
Option values. Option values explicitly indicate the presence orabsence of a value.
ARRAY - OCAML
make n x returns a fresh array of length n, initialized with x.All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one ofBOOL - OCAML
The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote.UNIT - OCAML
The unit type. The constructor is included here so that it has a path, but it is not intended to be used in user-defined data types.RANDOM - OCAML
Initialize the generator with a random seed chosen in a system-dependent way. If /dev/urandom is available on the host machine, it is used to provide a highly random initial seed. Otherwise, a less random seed is computed from system parameters (current time, process IDs).OCAML
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles OCAML – OCAMLLEARNDOCUMENTATIONPACKAGESCOMMUNITYNEWSCODE EXAMPLES OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles OCAML - THE MODULE SYSTEM - OCAML OCAML - THE CORE LIBRARY - OCAML The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’sOPTION - OCAML
Option values. Option values explicitly indicate the presence orabsence of a value.
ARRAY - OCAML
make n x returns a fresh array of length n, initialized with x.All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one ofBOOL - OCAML
The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote.UNIT - OCAML
The unit type. The constructor is included here so that it has a path, but it is not intended to be used in user-defined data types.RANDOM - OCAML
Initialize the generator with a random seed chosen in a system-dependent way. If /dev/urandom is available on the host machine, it is used to provide a highly random initial seed. Otherwise, a less random seed is computed from system parameters (current time, process IDs).OCAML
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented stylesOCAML – OCAML
OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented stylesSYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys.command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports. It can contain shell builtin commands such as echo, andCHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote.ARRAY - OCAML
make n x returns a fresh array of length n, initialized with x.All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of99 PROBLEMS
Your Help is Needed Many of the solutions below have been written by Victor Nicollet.Please contribute more solutions or improve the existing ones. 99 Problems (solved) in OCaml. This section is inspired by Ninety-Nine Lisp Problems which in turn was based on “Prolog problem list”. For each of these questions, some simple tests are shown—they may also serve to make the question clearer OCAML - BATCH COMPILATION (OCAMLC) - OCAML Batch compilation (ocamlc) 1 Overview of the compiler; 2 Options; 3 Modules and the file system; 4 Common errors; 5 Warning reference; This chapter describes the OCaml batch compiler ocamlc, which compiles OCaml source files to bytecode object files and links these object files to produce standalone bytecode executable files.These executable files are then run by the bytecode interpreter ocamlrun.STRING - OCAML
Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string MULTICORE OCAML: MAY 2021 22 hours ago · Welcome to the May 2021 Multicore OCaml monthly report! This month’s update along with the previous updates have been compiled by @avsm, @ctk21, @kayceesrk and @shakthimaan. Firstly, all of our upstream activity on the OCaml compiler is now reported as part of the shiny new compiler development newsletter #2 that @gasche has started. This represents a small but importantPRINTF - OCAML
fprintf outchan format arg1 argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan.. The format string is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing ofarguments.
CUSTOM DATA TYPES
Custom Data Types. In this tutorial we learn how to build our own types in OCaml, and how to write functions which process this new data. Built-in compound types OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of community OCAML - THE CORE LIBRARY - OCAML The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’sCHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote.ARRAY - OCAML
make n x returns a fresh array of length n, initialized with x.All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one ofLIST - OCAML
List operations. Some functions are flagged as not tail-recursive. A tail-recursive function uses constant stack space, while a non-tail-recursive function uses stack space proportional to the length of its list argument, which can be a problem with very longlists.
OPTION - OCAML
Option values. Option values explicitly indicate the presence orabsence of a value.
RANDOM - OCAML
Initialize the generator with a random seed chosen in a system-dependent way. If /dev/urandom is available on the host machine, it is used to provide a highly random initial seed. Otherwise, a less random seed is computed from system parameters (current time, process IDs).STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstOCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.UNIT - OCAML
The unit type. The constructor is included here so that it has a path, but it is not intended to be used in user-defined data types. OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of community OCAML - THE CORE LIBRARY - OCAML The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’sCHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote.ARRAY - OCAML
make n x returns a fresh array of length n, initialized with x.All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one ofLIST - OCAML
List operations. Some functions are flagged as not tail-recursive. A tail-recursive function uses constant stack space, while a non-tail-recursive function uses stack space proportional to the length of its list argument, which can be a problem with very longlists.
OPTION - OCAML
Option values. Option values explicitly indicate the presence orabsence of a value.
RANDOM - OCAML
Initialize the generator with a random seed chosen in a system-dependent way. If /dev/urandom is available on the host machine, it is used to provide a highly random initial seed. Otherwise, a less random seed is computed from system parameters (current time, process IDs).STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstOCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.UNIT - OCAML
The unit type. The constructor is included here so that it has a path, but it is not intended to be used in user-defined data types. OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of community OCAML - THE CORE LIBRARY The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’sLIST - OCAML
List operations. Some functions are flagged as not tail-recursive. A tail-recursive function uses constant stack space, while a non-tail-recursive function uses stack space proportional to the length of its list argument, which can be a problem with very longlists.
SYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys.command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports. It can contain shell builtin commands such as echo, andSTREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstOCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.FLOAT - OCAML
next_after x y returns the next representable floating-point value following x in the direction of y.More precisely, if y is greater (resp. less) than x, it returns the smallest (resp. largest) representable number greater (resp. less) than x.If x equals y, the function returns y.If x or y is nan, a nan is returned. Note that next_after max_float infinity = infinity and that next_after 0PRINTF - OCAML
fprintf outchan format arg1 argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan.. The format string is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing ofarguments.
THE STANDARD LIBRARY Chapter 20 The standard library. Conventions; This chapter describes the functions provided by the OCaml standard library. The modules from the standard library are automatically linked with the user’s object code files by the ocamlc command. Hence, these modules can be used in standalone programs without having to add any .cmo file on the command line for the linking phase. MULTICORE OCAML: MAY 2021 21 hours ago · Welcome to the May 2021 Multicore OCaml monthly report! This month’s update along with the previous updates have been compiled by @avsm, @ctk21, @kayceesrk and @shakthimaan. Firstly, all of our upstream activity on the OCaml compiler is now reported as part of the shiny new compiler development newsletter #2 that @gasche has started. This represents a small but importantOPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.LIST - OCAML
An alias for the type of lists. Return the length (number of elements) of the given list. Compare the lengths of two lists. compare_lengths l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.Since 4.05.0.
BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated. OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of communitySTREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstUNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.ARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.LIST - OCAML
An alias for the type of lists. Return the length (number of elements) of the given list. Compare the lengths of two lists. compare_lengths l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.Since 4.05.0.
BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated. OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of communitySTREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstUNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.ARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.LIST - OCAML
List operations. Some functions are flagged as not tail-recursive. A tail-recursive function uses constant stack space, while a non-tail-recursive function uses stack space proportional to the length of its list argument, which can be a problem with very longlists.
STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstSYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys.command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports. It can contain shell builtin commands such as echo, and OCAML - THE CORE LIBRARY The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’s OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of communityFLOAT - OCAML
next_after x y returns the next representable floating-point value following x in the direction of y.More precisely, if y is greater (resp. less) than x, it returns the smallest (resp. largest) representable number greater (resp. less) than x.If x equals y, the function returns y.If x or y is nan, a nan is returned. Note that next_after max_float infinity = infinity and that next_after 0INT - OCAML
This is an arithmetic shift: the sign bit of x is replicated and inserted in the vacated bits. The result is unspecified if n < 0 or n > Sys .int_size. val shift_right_logical : int -> int -> int. shift_right x n shifts x to the right by n bits. This is a logical shift: zeroes are inserted in the vacated bits regardless of the signof x.
OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.PRINTF - OCAML
fprintf outchan format arg1 argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan.. The format string is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing ofarguments.
MULTICORE OCAML: MAY 2021 Welcome to the May 2021 Multicore OCaml monthly report! This month’s update along with the previous updates have been compiled by @avsm, @ctk21, @kayceesrk and @shakthimaan. Firstly, all of our upstream activity on the OCaml compiler is now reported as part of the shiny new compiler development newsletter #2 that @gasche has started. This represents a small but important shift –INSTALL OCAML
Install OCaml. The latest version of OCaml is 4.12.0 . For more information about this release, see the 4.12.0 page. The OCaml compiler and libraries can be installed in several ways: With OPAM, the OCaml package manager (recommended). With a system package manager supported by your platform ( Linux, macOS, FreeBSD , OpenBSD, NetBSD,Windows)
OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated. OCAML - THE CORE LIBRARY - OCAML This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: It is automatically linked with the user’s object code files by the ocamlc command (chapter 9 ).ARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated.99 PROBLEMS
Your Help is Needed Many of the solutions below have been written by Victor Nicollet.Please contribute more solutions or improve the existing ones. 99 Problems (solved) in OCaml. This section is inspired by Ninety-Nine Lisp Problems which in turn was based on “Prolog problem list”. For each of these questions, some simple tests are shown—they may also serve to make the question clearerRANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.FILE MANIPULATION
STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.INSTALL OCAML
Install OCaml. The latest version of OCaml is 4.12.0 . For more information about this release, see the 4.12.0 page. The OCaml compiler and libraries can be installed in several ways: With OPAM, the OCaml package manager (recommended). With a system package manager supported by your platform ( Linux, macOS, FreeBSD , OpenBSD, NetBSD,Windows)
OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated. OCAML - THE CORE LIBRARY - OCAML This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: It is automatically linked with the user’s object code files by the ocamlc command (chapter 9 ).ARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated.99 PROBLEMS
Your Help is Needed Many of the solutions below have been written by Victor Nicollet.Please contribute more solutions or improve the existing ones. 99 Problems (solved) in OCaml. This section is inspired by Ninety-Nine Lisp Problems which in turn was based on “Prolog problem list”. For each of these questions, some simple tests are shown—they may also serve to make the question clearerRANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.FILE MANIPULATION
STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.OCAML – OCAML
OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles.INSTALL OCAML
Install OCaml. The latest version of OCaml is 4.12.0 . For more information about this release, see the 4.12.0 page. The OCaml compiler and libraries can be installed in several ways: With OPAM, the OCaml package manager (recommended). With a system package manager supported by your platform ( Linux, macOS, FreeBSD , OpenBSD, NetBSD,Windows)
OCAML - THE CORE LIBRARY - OCAML The core library; 1 Built-in types and predefined exceptions; 2 Module Stdlib: the initially opened module; This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: . It is automatically linked with the user’sTHE OCAML API
You may search bare values, like map, or indicate the module, like List.map, or type signatures, like int -> float.; To combine several keywords, just separate them by a space. Quotes "like this" can be used to prevent from splitting words at spaces.99 PROBLEMS
Your Help is Needed Many of the solutions below have been written by Victor Nicollet.Please contribute more solutions or improve the existing ones. 99 Problems (solved) in OCaml. This section is inspired by Ninety-Nine Lisp Problems which in turn was based on “Prolog problem list”. For each of these questions, some simple tests are shown—they may also serve to make the question clearerCHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.FILE MANIPULATION
File manipulation. This is a guide to basic file manipulation in OCaml using only the standard library. Official documentation for the modules of interest: the core library including the initially opened module Stdlib, Printf.. Buffered channelsUNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.PRINTF - OCAML
fprintf outchan format arg1 argN formats the arguments arg1 to argN according to the format string format, and outputs the resulting string on the channel outchan.. The format string is a character string which contains two types of objects: plain characters, which are simply copied to the output channel, and conversion specifications, each of which causes conversion and printing ofarguments.
LAZY - OCAML
A value of type ' a Lazy.t is a deferred computation, called a suspension, that has a result of type ' a.The special expression syntax lazy (expr) makes a suspension of the computation of expr, without computing expr itself yet. "Forcing" the suspension will then compute expr and return its result. Matching a suspension with the special pattern syntax lazy (pattern) also computes theLIST - OCAML
An alias for the type of lists. Return the length (number of elements) of the given list. Compare the lengths of two lists. compare_lengths l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.Since 4.05.0.
OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated.UNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.LIST - OCAML
An alias for the type of lists. Return the length (number of elements) of the given list. Compare the lengths of two lists. compare_lengths l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.Since 4.05.0.
OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated.UNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.OCAML – OCAML
OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles. OCAML LABS – OCAML OCaml Labs. The goal of OCaml Labs is to push OCaml and functional programming forward as a platform, making it a more effective tool for all users, including significant industrial users, while at the same time growing the appeal of the language, broadening its applicability and popularity. This will be achieved by a combination of technological advancements, creation of community OCAML - THE CORE LIBRARY - OCAML This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: It is automatically linked with the user’s object code files by the ocamlc command (chapter 9 ).STREAM - OCAML
Stream.from f returns a stream built from the function f.To create a new stream element, the function f is called with the current stream count. The user function f must return either Some for a value or None to specify the end of the stream.. Do note that the indices passed to f may not start at 0 in the general case. For example, would call f the firstFLOAT - OCAML
next_after x y returns the next representable floating-point value following x in the direction of y.More precisely, if y is greater (resp. less) than x, it returns the smallest (resp. largest) representable number greater (resp. less) than x.If x equals y, the function returns y.If x or y is nan, a nan is returned. Note that next_after max_float infinity = infinity and that next_after 0 OCAML - BATCH COMPILATION (OCAMLC) - OCAML Batch compilation (ocamlc) 1 Overview of the compiler; 2 Options; 3 Modules and the file system; 4 Common errors; 5 Warning reference; This chapter describes the OCaml batch compiler ocamlc, which compiles OCaml source files to bytecode object files and links these object files to produce standalone bytecode executable files.These executable files are then run by the bytecode interpreter ocamlrun.SYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys .command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports.SEQ - OCAML
The type ' a Seq .t is a delayed list, i.e. a list where some evaluation is needed to access the next element. This makes it possible to build infinite sequences, to build sequences as we traverse them, and to transform them in a lazy fashion rather than upfront. Since 4.07. type 'a t = unit -> 'a node. The type of delayedlists containing
LAZY - OCAML
A value of type ' a Lazy.t is a deferred computation, called a suspension, that has a result of type ' a.The special expression syntax lazy (expr) makes a suspension of the computation of expr, without computing expr itself yet. "Forcing" the suspension will then compute expr and return its result. Matching a suspension with the special pattern syntax lazy (pattern) also computes theOCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt. OCAML – OCAMLLEARNDOCUMENTATIONPACKAGESCOMMUNITYNEWSCODE EXAMPLES OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles.INSTALL OCAML
Install OCaml. The latest version of OCaml is 4.12.0 . For more information about this release, see the 4.12.0 page. The OCaml compiler and libraries can be installed in several ways: With OPAM, the OCaml package manager (recommended). With a system package manager supported by your platform ( Linux, macOS, FreeBSD , OpenBSD, NetBSD,Windows)
OCAML - THE CORE LIBRARY - OCAML This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: It is automatically linked with the user’s object code files by the ocamlc command (chapter 9 ).UNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.SYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys .command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports.RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.OCAML
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented styles OCAML – OCAMLLEARNDOCUMENTATIONPACKAGESCOMMUNITYNEWSCODE EXAMPLES OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles.INSTALL OCAML
Install OCaml. The latest version of OCaml is 4.12.0 . For more information about this release, see the 4.12.0 page. The OCaml compiler and libraries can be installed in several ways: With OPAM, the OCaml package manager (recommended). With a system package manager supported by your platform ( Linux, macOS, FreeBSD , OpenBSD, NetBSD,Windows)
OCAML - THE CORE LIBRARY - OCAML This chapter describes the OCaml core library, which is composed of declarations for built-in types and exceptions, plus the module Stdlib that provides basic operations on these built-in types. The Stdlib module is special in two ways: It is automatically linked with the user’s object code files by the ocamlc command (chapter 9 ).UNIT - OCAML
The unit type. type t = unit =. |. () The unit type. The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. val equal : t -> t -> bool. equal u1 u2 is true. val compare : t -> t -> int.OPTION - OCAML
Options. The type for option values. Either None or a value Some v. none is None. some v is Some v. value o ~default is v if o is Some v and default otherwise. Raises Invalid_argument otherwise. bind o f is f v if o is Some v and None if o is None. join oo is Some v if oo is Some ( Some v) and None otherwise.SYS - OCAML
Execute the given shell command and return its exit code. The argument of Sys .command is generally the name of a command followed by zero, one or several arguments, separated by whitespace. The given argument is interpreted by a shell: either the Windows shell cmd.exe for the Win32 ports of OCaml, or the POSIX shell sh for other ports.RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.STRING - OCAML
String. module String: sig .. end. Strings. A string s of length n is an indexable and immutable sequence of n bytes. For historical reasons these bytes are referred to as characters. The semantics of string functions is defined in terms of indices and positions. These are depicted and described as follows.OCAML WEEKLY NEWS
OCaml Weekly News. The OCaml Weekly News is a summary of the messages sent to the OCaml forums and mailing list compiled by Alan Schmitt.OCAML
A friendly place to discuss OCaml: an industrial-strength programming language supporting functional, imperative and object-oriented stylesOCAML – OCAML
OCaml is an industrial-strength programming language supporting functional, imperative and object-oriented styles.DOCS – OCAML
The OCaml Tutorials. The official OCaml tutorials (chapters 1 to 6 of the manual), written by the creators of the language, are the best place to start. They form a complete introduction to programming in OCaml, including the module system, objects, polymorphism, etc.LIST - OCAML
List operations. Some functions are flagged as not tail-recursive. A tail-recursive function uses constant stack space, while a non-tail-recursive function uses stack space proportional to the length of its list argument, which can be a problem with very longlists.
OCAML - BATCH COMPILATION (OCAMLC) - OCAML Batch compilation (ocamlc) 1 Overview of the compiler; 2 Options; 3 Modules and the file system; 4 Common errors; 5 Warning reference; This chapter describes the OCaml batch compiler ocamlc, which compiles OCaml source files to bytecode object files and links these object files to produce standalone bytecode executable files.These executable files are then run by the bytecode interpreter ocamlrun.CHAR - OCAML
Return a string representing the given character, with special characters escaped following the lexical conventions of OCaml. All characters outside the ASCII printable range (32..126) are escaped, as well as backslash, double-quote, and single-quote. val lowercase : char -> char. Deprecated.RANDOM - OCAML
Random .float bound returns a random floating-point number between 0 and bound (inclusive). If bound is negative, the result is negative or zero. If bound is 0, the result is 0. val bool : unit -> bool. Random .bool () returns true or false with probability 0.5 each.BOOL - OCAML
Booleans. The type of booleans (truth values). The constructors false and true are included here so that they have paths, but they are not intended to be used in user-defined data types. not b is the boolean negation of b. e0 && e1 is the lazy boolean conjunction of expressions e0 and e1 . If e0 evaluates to false, e1 is not evaluated.CUSTOM DATA TYPES
OCaml has support for lists built into the language. All elements of a list in OCaml must be the same type. To write a list, use: # ;; - : int list = (Note semicolons, NOT commas). is the empty list. A list has a head (the first element) and a tail (the restof the
ARRAY - OCAML
set a n x modifies array a in place, replacing element number n with x . You can also write a. (n) 'a -> 'a array. make n x returns a fresh array of length n , initialized with x .BUFFER - OCAML
create n returns a fresh buffer, initially empty. The n parameter is the initial size of the internal byte sequence that holds the buffer contents. That byte sequence is automatically reallocated when more than n characters are stored in the buffer, but shrinks back to n characters when reset is called. For best performance, n should be of the same order of magnitude as the number of* Learn
* Documentation
* Packages
* Community
* News
Edit this page
OCAML IS AN INDUSTRIAL STRENGTH PROGRAMMING LANGUAGE SUPPORTING FUNCTIONAL, IMPERATIVE AND OBJECT-ORIENTED STYLESInstall OCaml
* en
* fr
LEARN
Find out about OCaml , read about users , see code examples , go through tutorials and more .DOCUMENTATION
Install OCaml, look up package docs, access the Manual
, get the cheat
sheets and more .
PACKAGES
The OCaml Package Manager , gives you access to multiple versions of hundreds of packages.
COMMUNITY
Read the news feed , join the mailing lists, get support
, attend meetings , and find OCaml around the web . Got a question? Ask OCaml experts! Learn OCaml in your browser with TryOCamlNEWS
*
OCAML 2019
August 23, 2019
*
RELEASE OF OCAML 4.08.1June 14, 2019
*
OCAML WEEKLY NEWS
August 6, 2019
*
DOWN
July 23, 2019
*
OCSIGEN START AND OCSIGEN SERVER UPDATEDJuly 18, 2019
*
OCSIGEN START AND OCSIGEN SERVER UPDATEDJuly 18, 2019
*
OCAML DEVELOPER AT AHREFS PTE LTD (FULL-TIME)July 13, 2019
More...
A TASTE OF OCAML
#
(* Binary tree with leaves carrying an integer. *) type tree = Leaf of int | Node of tree * tree let rec exists_leaf test tree =match tree with
| Leaf v -> test v | Node (left, right) -> exists_leaf test left || exists_leaf test right let has_even_leaf tree = exists_leaf (fun n -> n mod 2 = 0) tree OCaml is a lot more powerful than this simple example shows. See moreexamples !
PACKAGES
* New packages
PACKAGE
VERSION
DATE
ocaml-freestanding
0.4.6
Aug 11, 2019
ocaml-src
4.08.1
Aug 11, 2019
dockerfile-opam
6.3.0
Aug 11, 2019
dockerfile-cmd
6.3.0
Aug 11, 2019
dockerfile
6.3.0
Aug 11, 2019
x509
0.7.1
Aug 11, 2019
LEARN
* Code Examples
* Tutorials
* Books
* Success Stories
*
DOCUMENTATION
* Install
* Manual
* Packages
* Compiler Releases
* Logos
COMMUNITY
* Mailing Lists
* Meetings
* News
* Support
* Bug Tracker
WEBSITE
* Edit this page
* Website Issues
* About This Site
* Find Us on GitHub
* Credits
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0