Format strings in OCaml – DEV Community

OCAML does not have string interpolation, however it does have C-style format strings (however type-safe). This is an instance: let good day title = Printf.printf “Good day, %s!n” title (* Will be written as: let good day = Printf.printf “Good day, %s!” *) Enter fullscreen mode Exit fullscreen mode That is type-safe in an virtually […]

Learn Lambda Calculus in 10 minutes with OCaml

I will train you the fundamentals of Lambda Calculus actually rapidly. Lambda Calculus is deep. However I am masking solely the basics right here. What’s Lambda Calculus? Lambda Calculus (LC) is a mannequin to explain computations. LC describes the syntax and semantics. Syntax A lambda expression (also referred to as lambda time period) may be […]

Tagging OCaml packages – DEV Community

TL;DR Add (tags (org:your-github-username)) to your dune-project file’s package deal stanza. About OCAML’s opam package deal supervisor has an sadly little-known characteristic calling ‘tagging’. This lets you give ‘tags’ or ‘labels’ to your packages and search utilizing these tags. This works so much like widespread running a blog platforms, like in reality! And even […]

Why Should You Learn OCaml?

Once I determined to be taught OCaml, one of many first talks I watched was Yaron Minsky’s ‘Why OCaml?’. The place he presents a few of the the reason why Jane Avenue have select OCaml because the language they’d use to construct nearly every part throughout the firm. What’s attention-grabbing, is that OCaml was the […]

Por que aprender OCaml? – DEV Community

Quando eu decidi aprender OCaml, uma das primeiras palestras que assisti foi a Por que OCaml? do Yaron Minsky. Onde ele apresenta algumas das razões pelas quais a Jane Road escolheu OCaml como a linguagem que iriam usar para construir quase tudo dentro da empresa. O que é interessante, é que OCaml foi uma linguagem […]

Simple JSON parser in c++, rust, ocaml, standard ml

I’ve written a easy ASCII-only JSON parser in C++, Rust, OCaml and Normal ML. This was accomplished for academic functions primarily. The main target was to be taught some extra about writing parsers by hand. One other level was to check implementations in these languages. I used to be principally focused on GC v non-GC. […]

Expressive Code with Pattern Matching

Have you ever ever discovered your self writing lengthy, cumbersome if-else chains in your code, simply to deal with just a few completely different circumstances? In that case, you will need to find out about sample matching. On this put up, we’ll discover the fundamentals of sample matching and the way it may also help […]

How to print anything in OCaml

ONE of the large advantages of OCaml is its highly effective REPL (additionally referred to as the toplevel), the interactive command-line utility the place you may load modules, sort in and execute code, and see its outcomes. The fashionable REPL, utop, has highly effective auto-completion and integration with the construct system dune, which permits productive […]