Skip to content

Commit

Permalink
B0ify.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuenzli committed Feb 9, 2022
1 parent aebf351 commit e1a7faf
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
_b0
_build
tmp
*~
\#*#
*.native
*.byte
*.install
3 changes: 2 additions & 1 deletion .merlin
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PKG b0.kit
S src
S test
B _build/**
B _b0/**
67 changes: 67 additions & 0 deletions B0.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
open B0_kit.V000
open B00_std

(* OCaml library names *)

let react = B0_ocaml.libname "react"
let react_top = B0_ocaml.libname "react.top"

let unix = B0_ocaml.libname "unix"
let compiler_libs_toplevel = B0_ocaml.libname "compiler-libs.toplevel"

(* Libraries *)

let react_lib =
let srcs = Fpath.[ `File (v "src/react.mli"); `File (v "src/react.ml") ] in
let requires = [] in
B0_ocaml.lib react ~doc:"The react library" ~srcs ~requires

let react_top_lib =
let srcs = Fpath.[ `File (v "src/react_top.ml") ] in
let requires = [compiler_libs_toplevel] in
let doc = "The react toplevel support library" in
B0_ocaml.lib react_top ~doc ~srcs ~requires

(* Tests *)

let test_exe ?(requires = []) src ~doc =
let src = Fpath.v src in
let srcs = Fpath.[`File src] in
let meta = B0_meta.(empty |> tag test) in
let requires = react :: requires in
B0_ocaml.exe (Fpath.basename ~no_ext:true src) ~srcs ~doc ~meta ~requires

let test = test_exe "test/test.ml" ~doc:"Test suite"
let clock =
test_exe "test/clock.ml" ~doc:"Reactive clock example" ~requires:[unix]

let breakout =
test_exe "test/breakout.ml" ~doc:"Breakout game example" ~requires:[unix]

(* Packs *)

let default =
let meta =
let open B0_meta in
empty
|> tag B0_opam.tag
|> add authors ["The react programmers"]
|> add maintainers ["Daniel Bünzli <daniel.buenzl [email protected]>"]
|> add homepage "https://erratique.ch/software/react"
|> add online_doc "https://erratique.ch/software/react/doc/"
|> add licenses ["ISC"]
|> add repo "git+https://erratique.ch/repos/react.git"
|> add issues "https://github.com/dbuenzli/react/issues"
|> add description_tags
["reactive"; "declarative"; "signal"; "event"; "frp"; "org:erratique"]
|> add B0_opam.Meta.depends
[ "ocaml", {|>= "4.08.0"|};
"ocamlfind", {|build|};
"ocamlbuild", {|build|};
"topkg", {|build & >= "1.0.3"|};
]
|> add B0_opam.Meta.build
{|[["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"]]|}
in
B0_pack.v "default" ~doc:"react package" ~meta ~locked:true @@
B0_unit.list ()
1 change: 1 addition & 0 deletions BRZO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(srcs-x pkg)
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


- Require OCaml >= 4.05.
- Handle deprecation of `Pervasives`.
- Require OCaml 4.08.
- Handle deprecation of `Pervasives` (and thus support OCaml 5.00)

v1.2.1 2017-03-16 La Forclaz (VS)
---------------------------------
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
React — Declarative events and signals for OCaml
-------------------------------------------------------------------------------
================================================
Release %%VERSION%%

React is an OCaml module for functional reactive programming (FRP). It
Expand All @@ -10,11 +10,9 @@ signal, it lets the client chooses the concrete timeline.
React is made of a single, independent, module and distributed under
the ISC license.

Home page: http://erratique.ch/software/react
Contact: Daniel Bünzli `<daniel.buenzl [email protected]>`
Homepage: <http://erratique.ch/software/react>


## Installation
# Installation

React can be installed with `opam`:

Expand All @@ -23,21 +21,19 @@ React can be installed with `opam`:
If you don't use `opam` consult the [`opam`](opam) file for build
instructions.

# Documentation

## Documentation

The documentation and API reference is automatically generated by
`ocamldoc` from the interfaces. It can be consulted [online][3]
and there is a generated version in the `doc` directory of the
distribution.
The documentation and API reference is automatically generated by from
the source interfaces. It can be consulted [online][doc] or via `odig
doc react`.

[3]: http://erratique.ch/software/react/doc/React
[doc]: http://erratique.ch/software/react/doc/


## Sample programs
# Sample programs

If you installed React with `opam` sample programs are located in
the directory `opam config var react:doc`.
the directory `opam var react:doc`.

In the distribution sample programs are located in the `test`
directory of the distribution. They can be built with:
Expand Down
6 changes: 1 addition & 5 deletions doc/index.mld
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ provides support to program with time varying values : declarative
events and signals. React doesn't define any primitive event or
signal, it lets the client chooses the concrete timeline.

{1:api API}

{!modules:
React
}
{!modules: React }
30 changes: 22 additions & 8 deletions opam
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
opam-version: "2.0"
name: "react"
synopsis: "Declarative events and signals for OCaml"
description: """\
Release %%VERSION%%

React is an OCaml module for functional reactive programming (FRP). It
provides support to program with time varying values : declarative
events and signals. React doesn't define any primitive event or
signal, it lets the client chooses the concrete timeline.

React is made of a single, independent, module and distributed under
the ISC license.

Homepage: <http://erratique.ch/software/react>"""
maintainer: "Daniel Bünzli <daniel.buenzl [email protected]>"
authors: "The react programmers"
license: "ISC"
tags: ["reactive" "declarative" "signal" "event" "frp" "org:erratique"]
homepage: "https://erratique.ch/software/react"
authors: ["The react programmers"]
doc: "https://erratique.ch/software/react/doc/React"
dev-repo: "git+https://erratique.ch/repos/react.git"
doc: "https://erratique.ch/software/react/doc/"
bug-reports: "https://github.com/dbuenzli/react/issues"
tags: [ "reactive" "declarative" "signal" "event" "frp" "org:erratique" ]
license: "ISC"
depends: [
"ocaml" {>= "4.08.0"}
"ocamlfind" {build}
"ocamlbuild" {build}
"topkg" {build & >= "1.0.1"}
"topkg" {build & >= "1.0.3"}
]
available: [ ocaml-version >= "4.05.0" ]
build: [[ "ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{pinned}%" ]]
build: ["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"]
dev-repo: "git+https://erratique.ch/repos/react.git"

0 comments on commit e1a7faf

Please sign in to comment.