package alba

  1. Overview
  2. Docs
Alba compiler

Install

Dune Dependency

Authors

Maintainers

Sources

0.4.3.tar.gz
sha256=062f33c55ef39706c4290dff67d5a00bf009051fd757f9352be527f629ae21fc
md5=eb4edc4d6b7e15b83d6397bd34994153

doc/alba.fmlib/Fmlib/Io/index.html

Module Fmlib.Io

Definition of an enviroment for console applications which can run natively or under nodejs or any other module which satisfies the signature SIG.

The Fmlib helps you to develop Ocaml programs which run natively and can be compiled to javascript without changing the code of the application.

You develop your program as a functor accepting a module argument of type SIG. The program does all input/ouptut via the module Io.

    (* Content of file [program.ml] *)
    module Make (Io: Io.SIG) =
    struct
        let run _: unit =
        let open Io in
        Process.execute
            (Stdout.line "Hello world")
    end

The library provides two instances of type Io.SIG. One is Fmlib_native.Io for native applications and the other is Fmlib_node.Io for nodejs applications.

You can make a native application by

    module P = Program.Make (Fmlib_native.Io)

    let _ =
        P.run ()

and a nodejs application by

    module P = Program.Make (Fmlib_node.Io)

    let _ =
        P.run ()
module Error : sig ... end

IO Errors

module type STAT = sig ... end

Statistic data about a file/directory.

module type SIG = sig ... end

Signature of an IO environment.

module Output (Io : SIG) : sig ... end
OCaml

Innovation. Community. Security.