[Pkg-ocaml-maint-commits] [tyxml] 05/19: Imported Upstream version 3.2.1
Mehdi Dogguy
mehdi at moszumanska.debian.org
Sun Oct 18 09:55:48 UTC 2015
This is an automated email from the git hooks/post-receive script.
mehdi pushed a commit to branch master
in repository tyxml.
commit ab1334fb1cea3ca3414d18ba04a9a920fdf8c99a
Author: Mehdi Dogguy <mehdi at debian.org>
Date: Sun Oct 18 11:15:59 2015 +0200
Imported Upstream version 3.2.1
---
CHANGES | 9 +++++++++
_oasis | 2 +-
doc/manual-wiki/functors.wiki | 24 +++++++++++++++++++++++-
lib/META | 10 +++++-----
lib/html5.mli | 11 +----------
lib/html5_f.mli | 39 ++++++++++-----------------------------
lib/html5_sigs.mli | 36 +++++++++++++++++++++++++++++++++++-
lib/svg.mli | 10 +---------
lib/svg_f.mli | 33 ++++++---------------------------
lib/svg_sigs.mli | 35 ++++++++++++++++++++++++++++++++---
setup.ml | 9 +++++----
11 files changed, 128 insertions(+), 90 deletions(-)
diff --git a/CHANGES b/CHANGES
index 0173738..82bc0d0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+===== dev ====
+
+===== 3.2.1 ====
+
+ * Add signature functors to ease export of module created with the functorial interface.
+ See the manual for more details.
+ * Fix variance for Svg.attrib.
+ * Fix export of Xml.list_wrap for Html5.M and Svg.M. Should fix syntax extension with those.
+
===== 3.2.0 ====
* Remove Xhtml.
diff --git a/_oasis b/_oasis
index 7e4f4ab..675e323 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
OASISFormat: 0.4
Name: tyxml
-Version: 3.2.0
+Version: 3.2.1
Homepage: http://ocsigen.org/tyxml/
Authors:
Thorsten Ohl,
diff --git a/doc/manual-wiki/functors.wiki b/doc/manual-wiki/functors.wiki
index efc07b6..d02fcee 100644
--- a/doc/manual-wiki/functors.wiki
+++ b/doc/manual-wiki/functors.wiki
@@ -13,7 +13,7 @@ Due to typing constraints (see next section), The ##Xml## implementation will al
==@@id="wrap"@@ Wrapping up the nodes ==
-Beside the ###Make## functor. those two modules provide a ##MakeWrapped## functor, which allows to wrap Xml elements in a monad.
+Beside the ##Make## functor. those two modules provide a ##MakeWrapped## functor, which allows to wrap Xml elements in a monad.
A good example of application is the ##R## modules with reactive nodes in eliom. Here is the simplified signature of the {{{div}}} element:
<<code language="ocaml"|R.div : 'a elt list signal -> div elt>>
@@ -23,3 +23,25 @@ In order to do this, You need to provide an additional ##Wrap## module to the fu
The ##Xml## implementation follow <<a_api | module Xml_sigs.Wrapped >>, which is the same as <<a_api| module Xml_sigs.T >>, but with arbitrary {{{'a wrap}}} type.
An identity wrapper, <<a_api| module Xml_wrap.NoWrap >>, is provided. The ##Make## functor is only ##MakeWrapped## partially applied to ##NoWrap##.
+
+
+==@@id="sig"@@ Exporting the correct signature ==
+
+In order to help export the correct signature after a functor application, four signature functors are provided: <<a_api| module Svg_sigs.Make >>, <<a_api| module Svg_sigs.MakeWrapped >>, <<a_api| module Html5_sigs.Make >> and <<a_api| module Html5_sigs.MakeWrapped >>.
+
+As an example of use, let us look at the module <<a_api| module Svg.M >>. Here is the definition of the module:
+<<code language="ocaml"|module M = Svg_f.Make(Xml)>>
+In this case, the declaration in the interface file should look like this:
+<<code language="ocaml"|module M : Svg_sigs.Make(Xml).T>>
+
+The signature functor <<a_api| module Svg_sigs.Make >> contains only a signature ##T##, which is equal to <<a_api| module Svg_sigs.T >>, but export various equalities with the module ##Xml##.
+
+You should **always** use a signature functor to give the type of a module produced by a functor application. It will ensure that exactly the right type equalities are exported and will naturally keep track of changes in tyxml.
+
+There are some important notes about theses signature functors:
+* {{{module M : Svg_sigs.Make(Xml).T}}} doesn't mean that {{{M.Xml}}} is a submodule of {{{Xml}}}. It only means that the types {{{uri}}}, {{{event_handler}}}, {{{mouse_event_handler}}}, {{{keyboard_event_handler}}}, {{{attrib}}} and {{{elt}}} are the same in both modules.
+In the same manner, <<a_api | module Svg_sigs.MakeWrapped>> doesn't force the {{{wrap}}} type to be consistent between ##W## and ##Xml## (as opposed to <<a_api | module Svg_f.MakeWrapped>>) and will just use the types from ##W##.
+This is useful when not exporting the exact module that was used in the functor, but another (smaller and simpler) module. This is the case in <<a_api| module Tyxml_js.R >>, for example.
+
+* <<a_api | module Html5_f >> and <<a_api | module Svg_f >> functors export two additional equalities, {{{+'a elt = Xml.elt}}} and {{{+'a attrib = Xml.attrib}}}. These equalities **should never be exported in a public interface**. Exporting them would break html typing by allowing to build invalid html trees.
+These equalities are useful internally, for example in eliom they are used to make {{{F.elt}}}, {{{D.elt}}} and {{{R.elt}}} equals.
diff --git a/lib/META b/lib/META
index 9d64211..844a010 100644
--- a/lib/META
+++ b/lib/META
@@ -1,6 +1,6 @@
# OASIS_START
-# DO NOT EDIT (digest: 1e6564791a81646f336f8ddfbde149d5)
-version = "3.2.0"
+# DO NOT EDIT (digest: a6fd6e6521a0512852d47b4b8b60917f)
+version = "3.2.1"
description = "HTML5 pages typed with polymorphic variants"
requires = "str"
archive(byte) = "tyxml.cma"
@@ -9,7 +9,7 @@ archive(native) = "tyxml.cmxa"
archive(native, plugin) = "tyxml.cmxs"
exists_if = "tyxml.cma"
package "syntax" (
- version = "3.2.0"
+ version = "3.2.1"
description = "HTML5 and SVG syntax extension"
requires = "camlp4"
archive(syntax, preprocessor) = "pa_tyxml.cma"
@@ -21,7 +21,7 @@ package "syntax" (
)
package "parser" (
- version = "3.2.0"
+ version = "3.2.1"
description = "Simple XML parser"
requires = "camlp4.lib"
archive(byte) = "tymlx_p.cma"
@@ -32,7 +32,7 @@ package "parser" (
)
package "functor" (
- version = "3.2.0"
+ version = "3.2.1"
description =
"HTML5 pages typed with polymorphic variants (Functor version)"
archive(byte) = "tyxml_f.cma"
diff --git a/lib/html5.mli b/lib/html5.mli
index 998cb01..a2d2dd3 100644
--- a/lib/html5.mli
+++ b/lib/html5.mli
@@ -22,16 +22,7 @@
@see <http://www.w3.org/TR/html5/> W3C Recommendation *)
(** Concrete implementation of HTML5 typesafe constructors *)
-module M : Html5_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and type 'a Xml.wrap = 'a
- and type 'a wrap = 'a
- and type 'a list_wrap = 'a list
- and module Svg := Svg.M
+module M : Html5_sigs.Make(Xml)(Svg.M).T
(** Simple printer for HTML5 documents *)
module P : Xml_sigs.Typed_simple_printer with type 'a elt := 'a M.elt
diff --git a/lib/html5_f.mli b/lib/html5_f.mli
index 8281940..88d1568 100644
--- a/lib/html5_f.mli
+++ b/lib/html5_f.mli
@@ -21,21 +21,13 @@
(** Typesafe constructors for HTML5 documents (Functorial interface) *)
-module Make(Xml : Xml_sigs.T)(Svg : Svg_sigs.T with module Xml := Xml)
- : Html5_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and module Svg := Svg
- and type +'a elt = Xml.elt
- and type 'a Xml.wrap = 'a
- and type 'a wrap = 'a
- and type 'a Xml.list_wrap = 'a list
- and type 'a list_wrap = 'a list
- and type 'a attrib = Xml.attrib
- and type uri = Xml.uri
+module Make
+ (Xml : Xml_sigs.T)
+ (Svg : Svg_sigs.T with module Xml := Xml)
+ : Html5_sigs.Make(Xml)(Svg).T
+ with type +'a elt = Xml.elt
+ and type +'a attrib = Xml.attrib
+
(** Like the {! Html5_f.Make } functor, but allows to wrap elements inside a monad described by {! Xml_wrap.T}.
See the functorial interface documentation for more details. *)
@@ -44,17 +36,6 @@ module MakeWrapped
(Xml : Xml_sigs.Wrapped with type 'a wrap = 'a W.t
and type 'a list_wrap = 'a W.tlist)
(Svg : Svg_sigs.T with module Xml := Xml)
- : Html5_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and module Svg := Svg
- and type +'a elt = Xml.elt
- and type 'a Xml.wrap = 'a W.t
- and type 'a wrap = 'a W.t
- and type 'a Xml.list_wrap = 'a W.tlist
- and type 'a list_wrap = 'a W.tlist
- and type 'a attrib = Xml.attrib
- and type uri = Xml.uri
+ : Html5_sigs.MakeWrapped(W)(Xml)(Svg).T
+ with type +'a elt = Xml.elt
+ and type +'a attrib = Xml.attrib
diff --git a/lib/html5_sigs.mli b/lib/html5_sigs.mli
index 51fe730..7580149 100644
--- a/lib/html5_sigs.mli
+++ b/lib/html5_sigs.mli
@@ -508,7 +508,6 @@ module type T = sig
(** {1 Phantom types and XML elements} *)
- (* For Ocsigen I need to specify the variance --Vincent *)
type +'a elt
type ('a, 'b) nullary = ?a: (('a attrib) list) -> unit -> 'b elt
@@ -1176,3 +1175,38 @@ module type T = sig
end
end
+
+(** {2 Signature functors} *)
+(** See {% <<a_manual chapter="functors"|the manual of the functorial interface>> %}. *)
+
+(** Signature functor for {!Html5_f.MakeWrapped}. *)
+module MakeWrapped
+ (W : Xml_wrap.T)
+ (Xml : Xml_sigs.Wrapped)
+ (Svg : Svg_sigs.T with module Xml := Xml) :
+sig
+
+ (** See {!modtype:Html5_sigs.T}. *)
+ module type T = T
+ with type Xml.uri = Xml.uri
+ and type Xml.event_handler = Xml.event_handler
+ and type Xml.mouse_event_handler = Xml.mouse_event_handler
+ and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
+ and type Xml.attrib = Xml.attrib
+ and type Xml.elt = Xml.elt
+ and module Svg := Svg
+ and type 'a Xml.wrap = 'a W.t
+ and type 'a wrap = 'a W.t
+ and type 'a Xml.list_wrap = 'a W.tlist
+ and type 'a list_wrap = 'a W.tlist
+end
+
+(** Signature functor for {!Html5_f.Make}. *)
+module Make
+ (Xml : Xml_sigs.T)
+ (Svg : Svg_sigs.T with module Xml := Xml) :
+sig
+
+ (** See {!modtype:Html5_sigs.MakeWrapped} and {!modtype:Html5_sigs.T}. *)
+ module type T = MakeWrapped(Xml_wrap.NoWrap)(Xml)(Svg).T
+end
diff --git a/lib/svg.mli b/lib/svg.mli
index 8d6b768..4753add 100644
--- a/lib/svg.mli
+++ b/lib/svg.mli
@@ -22,15 +22,7 @@
@see <http://www.w3.org/TR/SVG> W3C Recommendation *)
(** Concrete implementation of SVG typesafe constructors *)
-module M : Svg_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and type 'a Xml.wrap = 'a
- and type 'a wrap = 'a
- and type 'a list_wrap = 'a list
+module M : Svg_sigs.Make(Xml).T
(** Simple printer for SVG documents *)
module P : Xml_sigs.Typed_simple_printer with type 'a elt := 'a M.elt
diff --git a/lib/svg_f.mli b/lib/svg_f.mli
index 0809157..b1e5fc4 100644
--- a/lib/svg_f.mli
+++ b/lib/svg_f.mli
@@ -80,21 +80,10 @@ val string_of_transform : transform -> string
val string_of_transforms : transforms -> string
*)
-
module Make(Xml : Xml_sigs.T)
- : Svg_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and type +'a elt = Xml.elt
- and type 'a Xml.wrap = 'a
- and type 'a wrap = 'a
- and type 'a Xml.list_wrap = 'a list
- and type 'a list_wrap = 'a list
- and type 'a attrib = Xml.attrib
- and type uri = Xml.uri
+ : Svg_sigs.Make(Xml).T
+ with type +'a elt = Xml.elt
+ and type +'a attrib = Xml.attrib
(** Like the {! Svg_f.Make } functor, but allows to wrap elements inside a monad described by {! Xml_wrap.T}.
See the functorial interface documentation for more details. *)
@@ -102,16 +91,6 @@ module MakeWrapped
(W: Xml_wrap.T)
(Xml : Xml_sigs.Wrapped with type 'a wrap = 'a W.t
and type 'a list_wrap = 'a W.tlist)
- : Svg_sigs.T with type Xml.uri = Xml.uri
- and type Xml.event_handler = Xml.event_handler
- and type Xml.mouse_event_handler = Xml.mouse_event_handler
- and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
- and type Xml.attrib = Xml.attrib
- and type Xml.elt = Xml.elt
- and type +'a elt = Xml.elt
- and type 'a Xml.wrap = 'a W.t
- and type 'a wrap = 'a W.t
- and type 'a Xml.list_wrap = 'a W.tlist
- and type 'a list_wrap = 'a W.tlist
- and type 'a attrib = Xml.attrib
- and type uri = Xml.uri
+ : Svg_sigs.MakeWrapped(W)(Xml).T
+ with type +'a elt = Xml.elt
+ and type +'a attrib = Xml.attrib
diff --git a/lib/svg_sigs.mli b/lib/svg_sigs.mli
index 5be3098..9a19671 100644
--- a/lib/svg_sigs.mli
+++ b/lib/svg_sigs.mli
@@ -31,15 +31,13 @@ module type T = sig
(** {1 Abstraction over XML's types} *)
- type 'a attrib
+ type +'a attrib
type 'a wrap
type 'a list_wrap
type +'a elt
- type +'a elts
-
type ('a, 'b) nullary = ?a: (('a attrib) list) -> unit -> 'b elt
type ('a, 'b, 'c) unary = ?a: (('a attrib) list) -> 'b elt wrap -> 'c elt
@@ -872,3 +870,34 @@ module type T = sig
end
+
+(** {2 Signature functors} *)
+(** See {% <<a_manual chapter="functors"|the manual of the functorial interface>> %}. *)
+
+(** Signature functor for {!Svg_f.MakeWrapped}. *)
+module MakeWrapped
+ (W : Xml_wrap.T)
+ (Xml : Xml_sigs.Wrapped) :
+sig
+
+ (** See {!modtype:Svg_sigs.T}. *)
+ module type T = T
+ with type Xml.uri = Xml.uri
+ and type Xml.event_handler = Xml.event_handler
+ and type Xml.mouse_event_handler = Xml.mouse_event_handler
+ and type Xml.keyboard_event_handler = Xml.keyboard_event_handler
+ and type Xml.attrib = Xml.attrib
+ and type Xml.elt = Xml.elt
+ and type 'a Xml.wrap = 'a W.t
+ and type 'a wrap = 'a W.t
+ and type 'a Xml.list_wrap = 'a W.tlist
+ and type 'a list_wrap = 'a W.tlist
+end
+
+(** Signature functor for {!Svg_f.Make}. *)
+module Make(Xml : Xml_sigs.T) :
+sig
+
+ (** See {!modtype:Svg_sigs.MakeWrapped} and {!modtype:Svg_sigs.T}. *)
+ module type T = MakeWrapped(Xml_wrap.NoWrap)(Xml).T
+end
diff --git a/setup.ml b/setup.ml
index adc16c3..bc535f5 100644
--- a/setup.ml
+++ b/setup.ml
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 36e99d841629dd04997229575d4bc711) *)
+(* DO NOT EDIT (digest: 3aded4e69a60f79123e2280b32078d22) *)
(*
Regenerated by OASIS v0.4.5
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6655,7 +6655,7 @@ let setup_t =
alpha_features = ["pure_interface"; "compiled_setup_ml"];
beta_features = [];
name = "tyxml";
- version = "3.2.0";
+ version = "3.2.1";
license =
OASISLicense.DEP5License
(OASISLicense.DEP5Unit
@@ -6925,7 +6925,8 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.5";
- oasis_digest = Some "\023F\214\002\018\134#\237\024J\239?<\180+1";
+ oasis_digest =
+ Some "\167\206\238@\214\216S}\255\132,\132\015\012\011\027";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
@@ -6933,6 +6934,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
-# 6937 "setup.ml"
+# 6938 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/tyxml.git
More information about the Pkg-ocaml-maint-commits
mailing list