Other articles


  1. 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.

  2. 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.

  3. 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.

  4. Introduction to OCaml

    Preface

    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.

  5. Duck typing

    So called “duck typing” is often poorly explained and thus often misunderstood. Its name and the adage associated with it (“if it walks like a duck and quacks like a duck, then it is a duck”) don't do it any favors either.

    I've always found that analogy strange and misleading …

    read more

    There are comments.

links

social