Blog
The OCaml Planet RSS
Articles and videos contributed by both experts, companies and passionate developers from the OCaml community. From in-depth technical articles, project highlights, community news, or insights into Open Source projects, the OCaml Planet RSS feed aggregator has something for everyone.
Source
Keyword
Year
Author
Want your Blog Posts or Videos to Show Here?
To contribute a blog post, or add your RSS feed, check out the Contributing Guide on GitHub.
A beginner's guide to functional programming with OCaml
A couple of days ago I noticed on OCaml’s Discord server that someone was confused by OCaml function applications (invocations) like these:
When people think of OCaml they are usually thinking of compiling code to a binary before they are able to run it. While most OCaml code is indeed compiled to binaries, you don’t really need to do this, especially while you’re learning the language and are mostly playing with small exercises.
While learning OCaml I’ve noticed one curious feature - it has two types of string literals. The first type are the common and quite familiar “double-quoted string literals” (or perhaps simply “string literals”?):
While playing with OCaml I was surprised to learn there’s no built-in function the convert a string to a list of its characters. Admittedly, that’s not something you need very often, but it does come handy from time to time. There are many ways to implement such a function ourselves and the one I like the most makes use of List.init:
