diff options
author | Stephane Glondu <steph@glondu.net> | 2022-02-20 17:42:49 +0100 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2022-02-20 17:42:49 +0100 |
commit | bf2137958e66b671f7ebcefecf10cc3fdf25e099 (patch) | |
tree | 1855fa48075798df300481deb54390111339c2e6 | |
parent | c193592840b15532759105468790b51e1f108fcf (diff) | |
parent | fb0f705192e72927d676687957602b0a68f9ba21 (diff) |
Update upstream source from tag 'upstream/1.2.2'
Update to upstream version '1.2.2'
with Debian dir e93f8a4f35d66737e08d4722444ee3d0c56219b6
-rw-r--r-- | B0.ml | 67 | ||||
-rw-r--r-- | BRZO | 1 | ||||
-rw-r--r-- | CHANGES.md | 6 | ||||
-rw-r--r-- | LICENSE.md | 2 | ||||
-rw-r--r-- | README.md | 26 | ||||
-rw-r--r-- | _tags | 5 | ||||
-rw-r--r-- | doc/api.odocl | 1 | ||||
-rw-r--r-- | doc/index.mld | 8 | ||||
-rw-r--r-- | opam | 38 | ||||
-rw-r--r-- | pkg/META | 4 | ||||
-rwxr-xr-x | pkg/pkg.ml | 1 | ||||
-rw-r--r-- | src/react.ml | 12 | ||||
-rw-r--r-- | src/react.mli | 24 | ||||
-rw-r--r-- | src/react_top.ml | 5 | ||||
-rw-r--r-- | src/react_top_init.ml | 5 | ||||
-rw-r--r-- | test/breakout.ml | 5 | ||||
-rw-r--r-- | test/test.ml | 5 |
17 files changed, 150 insertions, 65 deletions
@@ -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 i@erratique.ch>"] + |> 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 () @@ -0,0 +1 @@ +(srcs-x pkg)
\ No newline at end of file @@ -1,3 +1,9 @@ +v1.2.2 2022-01-09 La Forclaz (VS) +--------------------------------- + +- Require OCaml 4.08. +- Handle deprecation of `Pervasives` (and thus support OCaml 5.00) + v1.2.1 2017-03-16 La Forclaz (VS) --------------------------------- @@ -1,4 +1,4 @@ -Copyright (c) 2009 Daniel C. Bünzli +Copyright (c) 2009 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -1,6 +1,6 @@ React — Declarative events and signals for OCaml -------------------------------------------------------------------------------- -Release v1.2.1 +================================================ +Release v1.2.2 React is an OCaml module for functional reactive programming (FRP). It provides support to program with time varying values : declarative @@ -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 i@erratique.ch>` +Homepage: <http://erratique.ch/software/react> - -## Installation +# Installation React can be installed with `opam`: @@ -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: @@ -1,9 +1,10 @@ -true : bin_annot, safe_string, package(bytes) +true : bin_annot, safe_string +<_b0> : -traverse <src> : include <src/react_top.*> : package(compiler-libs.toplevel) <test> : include <test/clock.{native,byte}> : use_unix <test/breakout.{native,byte}> : use_unix -<test/js_*.*> : package(js_of_ocaml), package(js_of_ocaml.ppx)
\ No newline at end of file +<test/js_*.*> : package(js_of_ocaml), package(js_of_ocaml-ppx)
\ No newline at end of file diff --git a/doc/api.odocl b/doc/api.odocl deleted file mode 100644 index 7a3b0be..0000000 --- a/doc/api.odocl +++ /dev/null @@ -1 +0,0 @@ -React diff --git a/doc/index.mld b/doc/index.mld new file mode 100644 index 0000000..c144fcf --- /dev/null +++ b/doc/index.mld @@ -0,0 +1,8 @@ +{0 React {%html: <span class="version">v1.2.2</span>%}} + +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. + +{!modules: React } @@ -1,19 +1,31 @@ -version: "1.2.1" -opam-version: "1.2" +version: "1.2.2" +opam-version: "2.0" +name: "react" +synopsis: "Declarative events and signals for OCaml" +description: """\ +Release v1.2.2 + +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 i@erratique.ch>" -homepage: "http://erratique.ch/software/react" -authors: ["Daniel Bünzli <daniel.buenzl i@erratique.ch>"] -doc: "http://erratique.ch/software/react/doc/React" -dev-repo: "http://erratique.ch/repos/react.git" -bug-reports: "https://github.com/dbuenzli/react/issues" -tags: [ "reactive" "declarative" "signal" "event" "frp" "org:erratique" ] +authors: "The react programmers" license: "ISC" +tags: ["reactive" "declarative" "signal" "event" "frp" "org:erratique"] +homepage: "https://erratique.ch/software/react" +doc: "https://erratique.ch/software/react/doc/" +bug-reports: "https://github.com/dbuenzli/react/issues" depends: [ + "ocaml" {>= "4.08.0"} "ocamlfind" {build} "ocamlbuild" {build} - "topkg" {build & >= "0.9.0"} + "topkg" {build & >= "1.0.3"} ] -available: [ ocaml-version >= "4.01.0" ] -build: -[[ "ocaml" "pkg/pkg.ml" "build" - "--dev-pkg" "%{pinned}%" ]]
\ No newline at end of file +build: ["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"] +dev-repo: "git+https://erratique.ch/repos/react.git" @@ -1,4 +1,4 @@ -version = "1.2.1" +version = "1.2.2" description = "Declarative events and signals for OCaml" requires = "" archive(byte) = "react.cma" @@ -7,7 +7,7 @@ plugin(byte) = "react.cma" plugin(native) = "react.cmxs" package "top" ( - version = "1.2.1" + version = "1.2.2" description = "React toplevel support" requires = "react" archive(byte) = "react_top.cma" @@ -16,6 +16,7 @@ let () = Pkg.test ~run:false "test/breakout"; Pkg.test ~run:false "test/clock"; Pkg.test "test/test"; + Pkg.doc "doc/index.mld" ~dst:"odoc-pages/index.mld"; (* jsoo_test ~cond:jsoo "test/js_hisig_test"; jsoo_test ~cond:jsoo "test/js_test"; *) ] diff --git a/src/react.ml b/src/react.ml index 1fde62e..4ef44bd 100644 --- a/src/react.ml +++ b/src/react.ml @@ -1,7 +1,6 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2009 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) let err_max_rank = "maximal rank exceeded" @@ -898,7 +897,7 @@ module E = struct add_dep m5 m'.enode; event m' p u - (* Pervasives support *) + (* Stdlib support *) module Option = struct let some e = map (fun v -> Some v) e @@ -1408,10 +1407,11 @@ module S = struct | s0, s1, s2, s3, s4, s5 -> app ~eq (l5 ~eq:( == ) f s0 s1 s2 s3 s4) s5 module Bool = struct + let stdlib_not = not let one = Const true let zero = Const false let eq : bool -> bool -> bool = ( = ) - let not s = l1 ~eq not s + let not s = l1 ~eq stdlib_not s let ( && ) s s' = l2 ~eq ( && ) s s' let ( || ) s s' = l2 ~eq ( || ) s s' @@ -1434,7 +1434,7 @@ module S = struct let rec p () = [ m.enode ] and u c = match !(m.ev) with | None -> () - | Some _ -> supdate (Pervasives.not (sval m')) m' c + | Some _ -> supdate (stdlib_not (sval m')) m' c in E.add_dep m m'.snode; signal ~i:b m' p u @@ -1682,7 +1682,7 @@ module S = struct end (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli + Copyright (c) 2009 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/src/react.mli b/src/react.mli index f86e1bf..9e7cd18 100644 --- a/src/react.mli +++ b/src/react.mli @@ -1,7 +1,6 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2009 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) (** Declarative events and signals. @@ -14,11 +13,9 @@ Consult the {{!sem}semantics}, the {{!basics}basics} and {{!ex}examples}. Open the module to use it, this defines only two - types and modules in your scope. + types and modules in your scope. *) - {e Release v1.2.1 - %%MAINTAINER%% } *) - -(** {1 Interface} *) +(** {1:interface Interface} *) type 'a event (** The type for events of type ['a]. *) @@ -258,7 +255,7 @@ module E : sig val l6 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g) -> 'a event -> 'b event -> 'c event -> 'd event -> 'e event -> 'f event -> 'g event - (** {1 Pervasives support} *) + (** {1:stdlib_support Stdlib support} *) (** Events with option occurences. *) module Option : sig @@ -438,7 +435,7 @@ module S : sig (** {1:acc Accumulating} *) val accum : ?eq:('a -> 'a -> bool) -> ('a -> 'a) event -> 'a -> 'a signal - (** [accum e i] is [S.hold i (]{!E.accum}[ e i)]. *) + (** [accum e i] is [S.hold i (]{!E.val-accum}[ e i)]. *) val fold : ?eq:('a -> 'a -> bool) -> ('a -> 'b -> 'a) -> 'a -> 'b event -> 'a signal @@ -520,7 +517,7 @@ module S : sig ('a signal -> 'b signal -> 'c signal -> 'd signal -> 'e signal -> 'f signal -> 'g signal) - (** The following modules lift some of [Pervasives] functions and + (** The following modules lift some of [Stdlib] functions and operators. *) module Bool : sig @@ -830,7 +827,8 @@ end occurrence for the event at the time it is called. The following code creates a primitive integer event [x] and generates three occurrences with value [1], [2], [3]. Those occurrences are printed - on stdout by the effectful event [pr_x]. {[open React;; + on stdout by the effectful event [pr_x]. +{[open React;; let x, send_x = E.create () let pr_x = E.map print_int x @@ -951,7 +949,7 @@ let () = Gc.full_major (); List.iter set_x [2; 2; 3]]} let fl x y = S.app (S.app ~eq:(==) (S.const f) x) y (* inefficient *) let fl' x y = S.l2 f x y (* efficient *) ]} - Besides, some of [Pervasives]'s functions and operators are + Besides, some of [Stdlib]'s functions and operators are already lifted and availables in submodules of {!S}. They can be be opened in specific scopes. For example if you are dealing with float signals you can open {!S.Float}. @@ -960,7 +958,7 @@ open React.S.Float let f t = sqrt t *. sin t (* f is defined on float signals *) ... -open Pervasives (* back to pervasives floats *) +open Stdlib (* back to Stdlib floats *) ]} If you are using OCaml 3.12 or later you can also use the [let open] construct @@ -1098,7 +1096,7 @@ let () = run ()]} *) (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli + Copyright (c) 2009 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/src/react_top.ml b/src/react_top.ml index 7c3190f..c3bde72 100644 --- a/src/react_top.ml +++ b/src/react_top.ml @@ -1,13 +1,12 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2014 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2014 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) let () = ignore (Toploop.use_file Format.err_formatter "react_top_init.ml") (*--------------------------------------------------------------------------- - Copyright (c) 2014 Daniel C. Bünzli + Copyright (c) 2014 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/src/react_top_init.ml b/src/react_top_init.ml index 77de1d7..09098bf 100644 --- a/src/react_top_init.ml +++ b/src/react_top_init.ml @@ -1,7 +1,6 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2014 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2014 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) open React @@ -10,7 +9,7 @@ open React (*--------------------------------------------------------------------------- - Copyright (c) 2014 Daniel C. Bünzli + Copyright (c) 2014 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/test/breakout.ml b/test/breakout.ml index 5b1d49b..e91d821 100644 --- a/test/breakout.ml +++ b/test/breakout.ml @@ -1,7 +1,6 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2009 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) (* Breakout clone. *) @@ -449,7 +448,7 @@ let main () = let ui = main () (* keep a ref. to avoid g.c. *) (*---------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli + Copyright (c) 2009 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/test/test.ml b/test/test.ml index 6888abc..9fcc950 100644 --- a/test/test.ml +++ b/test/test.ml @@ -1,7 +1,6 @@ (*--------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli. All rights reserved. + Copyright (c) 2009 The react programmers. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - react v1.2.1 ---------------------------------------------------------------------------*) (* Tests for react's combinators. @@ -1491,7 +1490,7 @@ let main () = let () = main () (*---------------------------------------------------------------------------- - Copyright (c) 2009 Daniel C. Bünzli + Copyright (c) 2009 The react programmers Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above |