Other articles

  1. Introduction to OCaml, part 5: exceptions, lists, and structural recursion


    In OCaml, exceptions are not objects, and there are no exception hierarchies. It may look unusual now, but in fact exceptions predate the rise of object oriented languages and it's more in line with original implementations. The advantage is that they are very lightweight.

    The syntax for defining exceptions …

    read more

    There are comments.

  2. Introduction to OCaml, part 4: higher order functions, parametric polymorphism and algebraic data types

    Higher order functions and parametric polymorphism

    Parametric polymorphism

    So far we have only worked with functions that take value of a single type known beforehand. However, we have already seen functions whose types were left without explanation, such as let hello _ = print_endline "hello world" that we used to demonstrate …

    read more

    There are comments.

  3. Introduction to OCaml, part 3

    Boolean values and conditional expressions

    This should have been covered earlier, but better late than even later.

    We already know that true and false are constants of the type bool. Let's learn how to use them.

    Equality and comparison operators

    OCaml provides the following equality and comparison operators: = (equal), <> (not …

    read more

    There are comments.

  4. Introduction to OCaml, part 2

    In the previous chapter we've learnt how to use variables and arithmetic functions. Now it's time to learn how to make our own functions.

    Anonymous functions

    We will start with anonymous functions. The reason is that in OCaml, names functions are simply anonymous functions bound to name, and the special …

    read more

    There are comments.

  5. Introduction to OCaml


    This post series started as a response to requests from some friends curious about OCaml. There are quite a few nice books already, but I realized that if I just recommend them any one of those books, it still will leave me with quite a few things to explain …

    read more

    There are comments.

Page 1 / 2 »