package quickterface

  1. Overview
  2. Docs
Quick-to-program app interfaces in OCaml for terminal and web

Install

dune-project
 Dependency

Authors

Maintainers

Sources

quickterface-0.1.0.tbz
sha256=8261e3819564fb5d05f1f313e62b73382152591d7a4349ae5b1b08a4fc2469f3
sha512=e739a971bb0e696ab716c168419c59a3d195922d2d1e4963106a845e3442ffa085b05106f36cceeec9b806bf7d6ef2c31e98db04911fbf73c5ac0ce626449d0f

doc/src/quickterface.web_app/web_app_intf.ml.html

Source file web_app_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
open! Core
open! Js_of_ocaml

module Web_app_io = struct
  include Quickterface_web_app_backend.App
  module Http_client = Cohttp_lwt_jsoo.Client
end

module type S = sig
  val run : unit -> unit Lwt.t
end

module Make (App : Quickterface.App.S) : S = struct
  module App = App (Web_app_io)

  let run () =
    let%lwt io = Web_app_io.make () in
    try%lwt App.main ~io ()
    with exn ->
      Web_app_io.console_log_error
        (sprintf "Fatal application error:\n%s" (Exn.to_string exn))
        ()
end