Skip to content

Instantly share code, notes, and snippets.

View dinosaure's full-sized avatar

Calascibetta Romain dinosaure

View GitHub Profile

Mr. MIME - Parse and generate emails

I'm glad to announce the first release of mrmime, a parser and a generator of emails. This library provides an OCaml way to analyze and craft an email. Then, the goal is to make the entire stack about email (such as SMTP or IMAP) to be able to provide then tools and unikernels around the email service.

In this article, we will show what is currently possible with mrmime and some others libraries around it and our next plan.

Mr. MIME - Parse and generate emails

I'm glad to announce the first release of mrmime, a parser and a generator of emails. This library provides an OCaml way to analyze and craft an email. Then, the goal is to make the entire stack about email (such as SMTP or IMAP) to be able to provide then tools and unikernels around the email service.

In this article, we will show what is currently possible with mrmime and some others libraries around it and our next plan.

open Mirage
let remote_k =
let doc = Key.Arg.info ~doc:"Remote git repository." ["r"; "remote"] in
Key.(create "remote" Arg.(opt string "https://github.com/roburio/udns.git" doc))
let dns_handler =
let packages = [
package "logs" ;
package "irmin-mirage";
let ( <.> ) f g = fun x -> f (g x)
module Buffer : sig
type 'a t = private bytes
and 'a rd = < rd : unit; .. > as 'a
and 'a wr = < wr : unit; .. > as 'a
and ro = < rd: unit; >
and rdwr = < rd: unit; wr: unit; >
#include <stdio.h>
void shift(unsigned char *a, int size, int shift) {
int carry = 0 ;
while (shift--) {
carry = 0;
for (int i = size - 1; i >= 0; i--) {
int next = (a[i] & 1) ? 0x80 : 0 ;
#include "minilzo.h"
#include <caml/bigarray.h>
#include <stdio.h>
#ifndef __unused
#define __unused(x) x __attribute__((unused))
#endif
#define __unit() value __unused(unit)

Conduit 3.0.0

I'm glad to announce the new release of [conduit][conduit]. Conduit is, technically, a framework which wants to provide an abstraction of protocols. It permits to implement free-dependencies protocols.

Introduction

The goal of Conduit is the abstraction of protocols. In OCaml, it exists several ways to abstract an implementation from something else. By this way, it

open Lwt.Infix
let ( >>? ) x f =
x >>= function Ok x -> f x | Error err -> Lwt.return (Error err)
let getline queue =
let exists ~predicate queue =
let pos = ref 0 and res = ref (-1) in
Ke.Rke.iter
(fun chr ->
(executable
(name main)
(libraries brr)
(modes js))
(rule (copy main.bc.js main.js))
(alias
(name app)
(deps main.js min.html))
type 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val return : 'a -> 'a t
val both : 'a t -> 'b t -> ('a * 'b) t
end
module Make (IO : IO) = struct
let run =
print_endline "Hello World!" ;