Think OCaml: How to Think Like a Computer Scientist

Think OCaml: How to Think Like a Computer Scientist

“Think OCaml: How to Think Like a Computer Scientist” is an introductory programming textbook based on the OCaml language. It is intended for newcomers to programming and also those who know some programming but want to learn programming in the function-oriented paradigm, or those who simply want to learn OCaml.


The goal of this book is to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.

The programming language you will learn is OCaml. OCaml is an example of a high-level language; other high-level languages you might have heard of are C, C++, Perl, Java and Python.

Table of Contents

  • The way of the program
  • Variables and Expressions
  • Functions
  • Program Flow
  • Recursive Functions
  • Algorithms
  • Strings
  • Lists
  • Case Study: Regular Expressions
  • Putting the O in OCaml, Part 1: Imperative programming
  • Arrays
  • Hashtables
  • Tuples
  • Records and Custom Data Structures
  • Putting the O in Ocaml Part 2: Objects and Classes
  • Case study: data structure selection

Book Details

Author(s): Nicholas Monje and Allen Downey
Publisher: Green Tea Press
Format(s): PDF, HTML
File size: 580 KB
Number of pages: 142
Link: Download.

Leave a Reply