jueves, 19 de marzo de 2015

Real World OCaml - Book Review

I finally finished reading the Real World OCaml book...and I really enjoyed it -:)


This book, just like all the "Real World" series gives you a deep introduction into the language and allow you to start coding pretty fast...of course...if you have used any Functional programming language before...that really helps and OCaml has of course some aspects that makes it not so easy to learn...


The more you read this book, the more you're going to like OCaml...it's a really nice language -:)

The book covers the basics like Lists and Patterns, Records, Variants and Error-Handling.  But of course it goes beyond with Functors, Objects and Command-Line Parsing...not letting important concepts like JSON handling Concurrent Programming aside. So...it's a pretty complete reference to start out.

By the way...the book is 509 pages...so it's pretty long...but full of examples and demonstrations...

Here's a little code that I wrote to flat out lists -;)

Flat_List.ml
open Core.Std

let rec flat list =
 match list with
  | [] -> ""
  | head :: tail -> head ^ (flat tail)

let () = 
 printf "%s" (flat ["1";"2";"3"])

Here's the result...


As you can see...OCaml is fun...so go ahead...read this book and expand your knowledge -;)

Greetings,

Blag.
Development Culture.

No hay comentarios: