Skip to content

Instantly share code, notes, and snippets.

@yurug
yurug / error.ml
Created June 13, 2019 14:48
The ErrorMonad in OCaml
module ErrorMonad : sig
type 'a t
val ret : 'a -> 'a t
val ( >>= ) : 'a t -> ('a -> 'b t) -> 'b t
val fail : 'a t
val run : 'a t -> 'a option
end = struct
type 'a t = 'a option
let ret x = Some x
let fail = None
@yurug
yurug / ocamooc3.md
Last active January 22, 2023 05:49

Learn functional programming with the OCaml programming language

Registrations are open!

Functional programming is attracting interest from a broad range of developers because it allows to write expressive, concise and elegant programs.

The course "Introduction to Functional programming using the OCaml language" introduces gradually the central notions of functional programming, via a set of video courses that are complemented by a

yann➜/tmp» cd test-git [19:39:38]
yann➜/tmp/test-git» ls [19:39:40]
yann➜/tmp/test-git» git init [19:39:40]
Initialized empty Git repository in /tmp/test-git/.git/
yann➜/tmp/test-git(master)» mkdir a [19:39:42]
yann➜/tmp/test-git(master)» touch a/b
yann➜/tmp» cd test-git [19:39:38]
yann➜/tmp/test-git» ls [19:39:40]
yann➜/tmp/test-git» git init [19:39:40]
Initialized empty Git repository in /tmp/test-git/.git/
yann➜/tmp/test-git(master)» mkdir a [19:39:42]
yann➜/tmp/test-git(master)» touch a/b