ocaml

Functor implementation issue

The aim of the module described below is to implement a module which once initiated by an integer n does all the operations based on the value of n. module ReturnSetZero = functor ( Elt : int ) -> struct let rec sublist b e l = match l with [] -> failwith "sublist" | h :: t -> ...

Difference between module <name> = struct .. end and module type <name> = struct.. end?

module <name> = struct .. end;; module type <name> = struct (* should have been sig *) .. end;; ...

Checking record size in ocaml?

Is there any way to check the size of a record in Ocaml? Something like sizeof of C/C++? ...

Random enumeration of a hash table in OCaml

Hi, Sorry for the long question. I decided to explain the context of the problem first as maybe there are other solutions to my problem. If you're in a hurry, just read THE QUESTION below. (EDITED -- In the mean time I added some attempts to solve the problem. The fourth one has my final conclusion, you can jump straight to it.) THE C...

Converting hash table to list of pairs (key,value) in OCaml

Hi guys, Is there a way of converting a hash table into a list of (key,pair) values in OCaml? I'm aware that, given a hash table ht we can do BatList.of_enum (BatHashtbl.enum ht) using the batteries library. This would convert the table to an enumeration and then convert the enum to a list. But I'm looking for a solution that doesn'...

Annotations in OCaml

Hello, the title could be somewhat misleading so let me explain what I'm trying to achieve. I'm writing a programming language that has a plethora of operators which can work on multiple types with different behaviour. The implementation is evolving and operators are changing/adapting to what I find more useful while trying it. The pro...

Non blocking receive in mpi+ocaml?

OcamlMpi has the instructions for blocking send and receive. Has anyone done a non-blocking receive for ocamlmpi? ...