Post has shared content
Does anyone know how to sneak in dependent types in OCaml using modules and functors ? (this is probably not possible).

I would like to define the type of lists having a certain fixed length.

I want recursive functors to sneak in user-defined type-functions ! Recursive modules in OCaml seem rather messy - a kind of mutual recursion:

a Python-style string to list function:

let rec split str car = if (String.index_opt str car) = None then [str] else
let a = (String.index str car) in [String.sub str 0 a ] @ split (String.sub str (a+1) ((String.length str)-a-1)) car;;

val split : string -> char -> string list = <fun>

Curio about the unit type:

Does unit behave as a kind of identity in the sense:

unit ; a = a ; unit = a for any type a ?

If I do:

class foo = object
val mutable n = 0
method boo = n <- n + 1; n
end ;;

then I get

class boo: object val mutable n: int method boo : int end

#let u = new boo;;
val u : boo = <obj>
# u#boo;;
- : int 1


OCaml version 4.06.1

# let a = ref 0;;
val a : int ref = {contents = 0}
# let f x = x + 1; a:= !a + 1;;
Warning 10: this expression should have type unit.
val f : int - > unit = <fun>
# f 2;;
- : unit = ()
# let g x = a:= !a+ 1; x + 1;;
val g : int - > int = <fun>
# g 2;;
- : int = 3

I actually like the Object layer of OCaml. There are whole books that do not even mention it...

Post has attachment

Post has attachment

Post has attachment
Dear OCaml users,

The release of OCaml version 4.07.0 is imminent. We have created
a release candidate for your testing pleasure. Please download
the sources, compile, install, and test your favourite software
with it, and let us know whether it works for you.

We want to know about any show-stopping bugs, especially
in the compilation and installation phases.

This release candidate is available as an opam switch 4.07.0+rc1,
and as source archive at this address:

Post has attachment
From +Daniel Bünzli


Unicode 11.0.0 was released yesterday. It adds 684 new characters to
the standard including the COPYLEFT SYMBOL (U+1F12F) character. See
[here][0] for details about the additions.

Accordingly the libraries mentioned at the end of this message had to
be updated, consult the individual release notes for details. Both
Uucd and Uucp are incompatible releases sinces new script and block
enumerants had to be added.

If Unicode still puzzles you, have a look at Uucp’s absolute minimal
Unicode [introduction][1] and a few [biased tips][2] to handle Unicode
in OCaml.

Best and happy copylefting,

Daniel Bünzli

# Uucd 11.0.0 Unicode character database decoder for OCaml.

# Uucp 11.0.0 Unicode character properties for OCaml.

# Uunf 11.0.0 Unicode text normalization for OCaml.

# Uuseg 11.0.0 Unicode text segmentation for OCaml.

2nd Release Candidate for opam 2.0.0.

This new RC fixes many small issues with the previous one, is much faster in
many areas, and brings sandboxing of package commands (enabled by default) on macOS and Linux.

See details at

We'd like to thanks all testers, and welcome all interested to report any issues
with this last release candidate.

Post has attachment
From Gerd Stolpmann:

A new version of findlib is available:

- Fix build with upcoming OCaml-4.07.
- The installation of graphics/META is now optional.
- Fix "ocamlfind query -d".
- The environment variable OCAMLFIND_IGNORE_DUPS_IN is now interpreted as a
list of directories.
- Packages for "ocamlfind query" may now be separated by commas, too.
- New "warning" property for packages.
- Forgetting to pass -thread/-vmthread only prints a warning now, but doesn't
stop the build.
- For dealing with case-sensitive filesystems it is now only tried to match
ASCII characters, but not encoding-dependent characters.

As usual, the details are available here:


This new release is on its way to opam-repository:

Also it is to be noted that this version now requires OCaml >= 4.00.0.

Wait while more posts are being loaded