Commits

camlspotter  committed 357523b

js_of_ocaml is now opammed

  • Participants
  • Parent commits a538a88
  • Branches opam

Comments (0)

Files changed (484)

File deriving-ocsigen/OMakefile

-OMyMakeDir(deriving-ocsigen, hnrgrgr-deriving-3a21a27, $(Installed type_conv))

File deriving-ocsigen/hnrgrgr-deriving-0.3b-ocsigen-1-g3a21a27.tar.gz

Binary file removed.

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/.gitignore

-.*.deps
-*.cm[iaox]
-*.cmxa
-*.cmxs
-*.cmxas
-*.a
-*.o
-*.annot
-._*
-*~
-#*#
-tests/tests
-files/META
-files/META.deriving-ocsigen
-syntax/deriving
-syntax/deriving.opt
-syntax/id.ml
-syntax/defs.ml

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/CHANGES

-== 0.3-ocsigen
-
-  * Use "lazy first-order module" instead of "recursive module" to be
-    compatible with {{{js_of_ocaml}}}.
-  * Be less restrictive with mutually recursive type definition
-  * Split runtime into deriving.cma and deriving_num.cma
-
-  * Class:
-  ** Typeable: use OCaml's lazy for {{{type_rep}}}
-  ** Show: added separators to {{{map}}} and {{{set}}}
-  ** Show, Dump and Eq: Allow polymorphic type fields.
-
-== 0.2-ocsigen
-
-  * Add compatibility with ocamlfind
-  * Add a type-conv compatibility mode
-  * Simplify the definition of new class
-
-  * Syntax: Add {{{Class<typ>}}} in module_expr.
-
-  * Small bug fixes in class:
-  ** Show: Added parentheses around tuples.
-  ** Pickle: remove warning in generated code.
-
-== 0.1.1
-
-  * Renamed serialisation classes:
-  ** Pickle -> Dump
-  ** Shelve -> Pickle
-  * Made Dump and Pickle interface compatible with each other and more
-    compatible with Marshal.
-  * Bugfix in the tag hash function on 64-bit platforms.
-  * Fixed a bug with a functor application quotation that used revised
-    syntax.
-
-== 0.1
-
-  * Initial release

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/COPYING

-The MIT License
-
-Copyright (c) 2007 Jeremy Yallop
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/Makefile

-include Makefile.config
-
-all: files/META files/META.${PROJECTNAME}
-	${MAKE} -C syntax
-	${MAKE} -C lib
-
-byte: files/META files/META.${PROJECTNAME}
-	${MAKE} -C syntax byte
-	${MAKE} -C lib byte
-
-opt: files/META files/META.${PROJECTNAME}
-	${MAKE} -C syntax opt
-	${MAKE} -C lib opt
-
-files/META: files/META.in
-	sed -e "s%__NAME__%${PROJECTNAME}%" \
-            -e "s%__LIBDIR__%%" \
-            -e "s%__SYNTAXDIR__%%" \
-	  $< > $@
-
-files/META.${PROJECTNAME}: files/META.in
-	sed -e "s%__NAME__%${PROJECTNAME}%" \
-            -e "s%__LIBDIR__%directory = \"../lib\"%" \
-            -e "s%__SYNTAXDIR__%directory = \"../syntax\"%" \
-	  $< > $@
-
-clean: clean.local
-	${MAKE} -C syntax clean DEPEND=no
-	${MAKE} -C lib clean DEPEND=no
-	${MAKE} -C tests clean
-clean.local:
-	-rm -f files/META files/META.${PROJECTNAME}
-
-distclean: clean.local
-	${MAKE} -C syntax distclean DEPEND=no
-	${MAKE} -C lib distclean DEPEND=no
-	${MAKE} -C tests distclean
-	-rm -f *~ \#* .\#*
-
-.PHONY: tests
-tests:
-	${MAKE} -C tests
-	./tests/tests
-
-include Makefile.filelist
-VERSION := $(shell head -n 1 VERSION)
-
-install:
-	${OCAMLFIND} install ${PROJECTNAME} \
-	  -patch-version ${VERSION} \
-	  files/META ${SYNTAX_INTF} ${INTF} ${IMPL} ${NATIMPL} ${DOC}
-
-install-byte:
-	${OCAMLFIND} install ${PROJECTNAME} \
-	  -patch-version ${VERSION} \
-	  files/META ${SYNTAX_INTF} ${INTF} ${IMPL} ${DOC}
-
-install-opt:
-	${OCAMLFIND} install ${PROJECTNAME} \
-	  -patch-version ${VERSION} \
-	  files/META ${SYNTAX_INTF} ${INTF} ${NATIMPL} ${DOC}
-
-uninstall:
-	${OCAMLFIND} remove ${PROJECTNAME}
-
-reinstall: uninstall install
-reinstall-byte: uninstall install-byte
-reinstall-opt: uninstall install-opt

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/Makefile.config

-
-PROJECTNAME := deriving-ocsigen
-OCAMLFIND := ocamlfind
-
-NATDYNLINK :=YES
-
-TYPECONV := $(shell ${OCAMLFIND} query type-conv 2>/dev/null)
-
-OBJEXT := .o
-LIBEXT := .a
-EXEEXT :=
-

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/Makefile.filelist

-INTF := syntax/pa_deriving_common.cmi \
-        lib/deriving_Dump.cmi \
-	lib/deriving_monad.cmi \
-	lib/deriving_dynmap.cmi \
-	lib/deriving_Show.cmi \
-	lib/deriving_Functor.cmi \
-	lib/deriving_Bounded.cmi \
-	lib/deriving_Typeable.cmi \
-	lib/deriving_Enum.cmi \
-	lib/deriving_interned.cmi \
-	lib/deriving_Eq.cmi \
-	lib/deriving_Pickle.cmi \
-	lib/deriving_num.cmi \
-
-IMPL := syntax/pa_deriving.cma \
-        lib/deriving.cma \
-        lib/deriving_num.cma \
-
-NATIMPL := syntax/pa_deriving.cmxa \
-           syntax/pa_deriving$(LIBEXT) \
-           lib/deriving.cmxa \
-           lib/deriving$(LIBEXT) \
-           lib/deriving_num.cmxa \
-           lib/deriving_num$(LIBEXT) \
-
-NATIMPL += ${INTF:.cmi=.cmx}
-
-ifeq "${NATDYNLINK}" "YES"
-NATIMPL += syntax/pa_deriving.cmxs \
-	   lib/deriving.cmxs       \
-	   lib/deriving_num.cmxs
-endif
-
-ifneq (${TYPECONV},)
-
-IMPL += syntax/pa_deriving_tc.cma \
-
-NATIMPL += syntax/pa_deriving_tc.cmxa \
-           syntax/pa_deriving_tc$(LIBEXT) \
-
-ifeq "${NATDYNLINK}" "YES"
-NATIMPL += syntax/pa_deriving_tc.cmxs
-endif
-
-endif
-
-NOMLI := syntax/pa_deriving_common.mli
-
-DOC := ${filter-out ${NOMLI}, ${INTF:.cmi=.mli}}

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/README

-This release of deriving-ocsigen library is based on the deriving
-library by Jeremy Yallop. See:
-
-  http://code.google.com/p/deriving/
-  https://github.com/jaked/deriving
-
-See CHANGES for a summary of changes.
-
-######
-
-Requirements:
-=============
-
- * ocaml and camlp4 (>= 3.12)
- * type-conv (optionnal)
-
-Build intructions:
-==================
-
- $ ${EDITOR} Makefile.config
- $ make
-
- $ make tests
-
- # make install
-
-Examples:
-=========
-
- $ ocaml
-        Objective Caml version 3.12.0
-
- # #use "topfind";;
- - : unit = ()
- # #camlp4o;;
-	Camlp4 Parsing version 3.12.0
-
- # #require "deriving-ocsigen.syntax";;
- # type t = A of int | B of t deriving (Show);;
- type t = A of int | B of t
- module rec Show_t : sig ... end
- # Show.show<t> (B (A 4));;
- - : string = "B A 4"
-
-Examples with type-conv:
-========================
-
- $ ocaml
-        Objective Caml version 3.12.0
-
- # #use "topfind";;
- - : unit = ()
- # #camlp4o;;
-	Camlp4 Parsing version 3.12.0
-
- # #require "type-conv";;
- # #require "deriving-ocsigen.syntax_tc";;
- # type t = A of int | B of t with show;;
- type t = A of int | B of t
- module rec Show_t : sig ... end
-
-Documention and examples of the original library:
-=================================================
-
-   http://code.google.com/p/deriving/wiki/Introduction
-   http://code.google.com/p/deriving/wiki/Classes
-

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/VERSION

-0.3-ocsigen

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/files/META.in

-version = "dev"
-description = "Deriving (patched for the Ocsigen project)"
-__LIBDIR__
-
-requires        = "__NAME__.base,num"
-archive(byte)   = "deriving_num.cma"
-archive(native) = "deriving_num.cmxa"
-
-package "base" (
-  archive(byte)   = "deriving.cma"
-  archive(native) = "deriving.cmxa"
-)
-
-package "syntax" (
-  __SYNTAXDIR__
-  exists_if = "pa_deriving.cma"
-  requires(syntax) = "camlp4,unix"
-  requires(syntax, toploop) += "__NAME__"
-  archive(syntax, preprocessor) = "pa_deriving.cma"
-  archive(syntax, toploop) = "pa_deriving.cma"
-  package "base" (
-    requires(syntax) = "camlp4"
-    archive(syntax, preprocessor) = "pa_deriving_common.cmo pa_deriving.cmo"
-    archive(syntax, toploop) = "pa_deriving_common.cmo pa_deriving.cmo"
-  )
-)
-
-## Presence of type-conv shoud be detected with the predicate "pkg_type-conv"
-## However the 'dash' in an predicat name is invalid... (GH 2011/03).
-
-package "syntax_tc" (
-  __SYNTAXDIR__
-  exists_if = "pa_deriving_tc.cma"
-  requires(syntax) = "camlp4,unix,type-conv"
-  requires(syntax, toploop) += "__NAME__"
-  archive(syntax, preprocessor) = "pa_deriving_tc.cma"
-  archive(syntax, toploop) = "pa_deriving_tc.cma"
-  package "base" (
-    requires(syntax) = "camlp4"
-    archive(syntax, preprocessor) = "pa_deriving_common.cmo pa_deriving_tc.cmo"
-    archive(syntax, toploop) = "pa_deriving_common.cmo pa_deriving_tc.cmo"
-  )
-)

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/.depend

-deriving_Bounded.cmo: deriving_Bounded.cmi
-deriving_Bounded.cmx: deriving_Bounded.cmi
-deriving_Bounded.cmi:
-deriving_Dump.cmo: deriving_Dump.cmi
-deriving_Dump.cmx: deriving_Dump.cmi
-deriving_Dump.cmi:
-deriving_Enum.cmo: deriving_Bounded.cmi deriving_Enum.cmi
-deriving_Enum.cmx: deriving_Bounded.cmx deriving_Enum.cmi
-deriving_Enum.cmi: deriving_Bounded.cmi
-deriving_Eq.cmo: deriving_Eq.cmi
-deriving_Eq.cmx: deriving_Eq.cmi
-deriving_Eq.cmi:
-deriving_Functor.cmo: deriving_monad.cmi deriving_Functor.cmi
-deriving_Functor.cmx: deriving_monad.cmx deriving_Functor.cmi
-deriving_Functor.cmi: deriving_monad.cmi
-deriving_Pickle.cmo: deriving_monad.cmi deriving_dynmap.cmi \
-    deriving_Typeable.cmi deriving_Show.cmi deriving_Eq.cmi deriving_Dump.cmi \
-    deriving_Pickle.cmi
-deriving_Pickle.cmx: deriving_monad.cmx deriving_dynmap.cmx \
-    deriving_Typeable.cmx deriving_Show.cmx deriving_Eq.cmx deriving_Dump.cmx \
-    deriving_Pickle.cmi
-deriving_Pickle.cmi: deriving_monad.cmi deriving_Typeable.cmi deriving_Eq.cmi \
-    deriving_Dump.cmi
-deriving_Show.cmo: deriving_Show.cmi
-deriving_Show.cmx: deriving_Show.cmi
-deriving_Show.cmi:
-deriving_Typeable.cmo: deriving_interned.cmi deriving_Typeable.cmi
-deriving_Typeable.cmx: deriving_interned.cmx deriving_Typeable.cmi
-deriving_Typeable.cmi:
-deriving_dynmap.cmo: deriving_Typeable.cmi deriving_Eq.cmi \
-    deriving_dynmap.cmi
-deriving_dynmap.cmx: deriving_Typeable.cmx deriving_Eq.cmx \
-    deriving_dynmap.cmi
-deriving_dynmap.cmi: deriving_Typeable.cmi deriving_Eq.cmi
-deriving_interned.cmo: deriving_Show.cmi deriving_interned.cmi
-deriving_interned.cmx: deriving_Show.cmx deriving_interned.cmi
-deriving_interned.cmi:
-deriving_monad.cmo: deriving_monad.cmi
-deriving_monad.cmx: deriving_monad.cmi
-deriving_monad.cmi:
-deriving_num.cmo: deriving_Typeable.cmi deriving_Show.cmi deriving_Pickle.cmi \
-    deriving_Eq.cmi deriving_Dump.cmi deriving_num.cmi
-deriving_num.cmx: deriving_Typeable.cmx deriving_Show.cmx deriving_Pickle.cmx \
-    deriving_Eq.cmx deriving_Dump.cmx deriving_num.cmi
-deriving_num.cmi: deriving_Typeable.cmi deriving_Show.cmi deriving_Pickle.cmi \
-    deriving_Eq.cmi deriving_Dump.cmi
-deriving_util.cmi:

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/Makefile

-include ../Makefile.config
-
-OCAMLC     := ${OCAMLFIND} ocamlc
-OCAMLOPT   := ${OCAMLFIND} ocamlopt
-OCAMLDEP   := ${OCAMLFIND} ocamldep
-PP         := -package camlp4 -ppopt ../syntax/pa_deriving.cma -syntax camlp4o
-
-OCAMLFLAGS := -w ae
-
-SOURCES = deriving_Show.ml           \
-          deriving_interned.ml       \
-          deriving_Eq.ml             \
-          deriving_Bounded.ml        \
-          deriving_Enum.ml           \
-          deriving_monad.ml          \
-          deriving_Dump.ml           \
-          deriving_Typeable.ml       \
-          deriving_dynmap.ml         \
-          deriving_Pickle.ml	     \
-          deriving_Functor.ml        \
-
-##
-
-all: byte opt
-
-byte: deriving.cma deriving_num.cma
-opt:: deriving.cmxa deriving_num.cmxa
-ifeq "${NATDYNLINK}" "YES"
-opt:: deriving.cmxs deriving_num.cmxs
-endif
-
-##
-
-deriving.cma: ${SOURCES:.ml=.cmo}
-	${OCAMLC} -a -o $@ $^
-deriving.cmxa: ${SOURCES:.ml=.cmx}
-	${OCAMLOPT} -a -o $@ $^
-
-
-deriving_num.cma: deriving_num.cmo
-	${OCAMLC} -a -o $@ $^
-deriving_num.cmxa: deriving_num.cmx
-	${OCAMLOPT} -a -o $@ $^
-
-# Common rules
-
-%.cmi: %.mli
-	${OCAMLC} ${OCAMLFLAGS} ${PP} -c $<
-%.cmo: %.ml
-	${OCAMLC} ${OCAMLFLAGS} ${PP} -c $<
-%.cmx: %.ml
-	${OCAMLOPT} ${OCAMLFLAGS} ${PP} -c $<
-%.cmxs: %.cmxa
-	$(OCAMLOPT) -shared -linkall -o $@ $<
-
-# Clean up
-clean:
-	-rm -f *.cm[ioax] *.cmxa *.cmxs *${OBJEXT} *${LIBEXT} *.annot
-distclean: clean
-	-rm -f .*.deps
-	-rm -f *~ \#* .\#*
-
-# Dependencies
-
-DEPS := $(patsubst %.ml,.%.ml.deps,$(wildcard *.ml)) \
-        $(patsubst %.mli,.%.mli.deps,$(wildcard *.mli))
-
-.depend: ${DEPS}
-	cat .*.deps > .depend
-
-.SECONDARY: ${DEPS}
-.%.ml.deps: %.ml
-	${OCAMLDEP} ${PP} $^ > $@
-.%.mli.deps: %.mli
-	${OCAMLDEP} ${PP} $^ > $@
-
-ifneq (${DEPEND},no)
-include .depend
-endif

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Bounded.ml

-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-(** Primitive instanecs for bounded **)
-module Deriving_Bounded = struct
-module type Bounded = sig
-  type a
-  val min_bound : a
-  val max_bound : a
-end
-
-module Bounded_integer(B : sig type t
-                               val max_int : t
-                               val min_int : t
-                       end) : Bounded with type a = B.t =
-struct 
-  type a = B.t
-  let min_bound = B.min_int
-  let max_bound = B.max_int
-end
-module Bounded_int32 = Bounded_integer(Int32)
-module Bounded_int64 = Bounded_integer(Int64)
-module Bounded_nativeint = Bounded_integer(Nativeint)
-module Bounded_int = struct
-  type a = int
-  let min_bound = Pervasives.min_int
-  let max_bound = Pervasives.max_int
-end
-module Bounded_bool = struct
-  type a = bool
-  let min_bound = false
-  let max_bound = true
-end
-module Bounded_char = struct
-  type a = char
-  let min_bound = Char.chr 0
-  let max_bound = Char.chr 0xff (* Is this guaranteed? *)
-end
-module Bounded_unit = struct
-  type a = unit
-  let min_bound = ()
-  let max_bound = ()
-end 
-end
-include Deriving_Bounded
-type open_flag = Pervasives.open_flag  =
-                 | Open_rdonly
-                 | Open_wronly
-                 | Open_append
-                 | Open_creat
-                 | Open_trunc
-                 | Open_excl
-                 | Open_binary
-                 | Open_text
-                 | Open_nonblock
-                     deriving (Bounded)
-
-type fpclass = Pervasives.fpclass =
-               | FP_normal
-               | FP_subnormal
-               | FP_zero
-               | FP_infinite
-               | FP_nan
-                   deriving (Bounded)

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Bounded.mli

-module type Bounded = 
-sig
-  type a
-  val min_bound : a 
-  val max_bound : a 
-end
-
-module Bounded_bool      : Bounded with type a = bool
-module Bounded_char      : Bounded with type a = char
-module Bounded_int       : Bounded with type a = int
-module Bounded_int32     : Bounded with type a = int32
-module Bounded_int64     : Bounded with type a = int64
-module Bounded_nativeint : Bounded with type a = nativeint
-module Bounded_unit      : Bounded with type a = unit
-module Bounded_open_flag : Bounded with type a = Pervasives.open_flag
-module Bounded_fpclass   : Bounded with type a = Pervasives.fpclass

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Dump.ml

-(** Dump **)
-
-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-(* TODO: we could have an additional debugging deserialisation method. *)
-module type Dump = sig
-  type a
-    val to_buffer : Buffer.t -> a -> unit
-    val to_string : a -> string
-    val to_channel : out_channel -> a -> unit
-    val from_stream : char Stream.t -> a
-    val from_string : string -> a
-    val from_channel : in_channel -> a
-end
-
-module type SimpleDump = sig
-  type a
-  val to_buffer : Buffer.t -> a -> unit
-  val from_stream : char Stream.t -> a
-end
-
-exception Dump_error of string
-
-let bad_tag tag stream typename =
-  raise (Dump_error
-           (Printf.sprintf 
-              "Dump: failure during %s deserialisation at character %d; unexpected tag %d" 
-              typename (Stream.count stream) tag))
-
-module Defaults (P : sig   
-			  type a
-			  val to_buffer : Buffer.t -> a -> unit
-			  val from_stream : char Stream.t -> a
-			end) : Dump with type a = P.a = 
-struct
-  include P
-
- (* is there a reasonable value to use here? *)
-  let buffer_size = 128
-
-  let to_string obj = 
-    let buffer = Buffer.create buffer_size in
-      P.to_buffer buffer obj;
-      Buffer.contents buffer
-      (* should we explicitly deallocate the buffer? *)
-  and from_string string = P.from_stream (Stream.of_string string)
-  and from_channel in_channel = 
-    from_stream (Stream.of_channel in_channel)
-  and to_channel out_channel obj = 
-    let buffer = Buffer.create buffer_size in
-      P.to_buffer buffer obj;
-      Buffer.output_buffer out_channel buffer
-end
-
-
-(* Generic int dumper.  This should work for any (fixed-size) integer
-   type with suitable operations. *)
-module Dump_intN (P : sig
-                      type t
-                      val zero : t
-                      val logand : t -> t -> t
-                      val logor : t -> t -> t
-                      val lognot : t -> t
-                      val shift_right_logical : t -> int -> t
-                      val shift_left : t -> int -> t
-                      val of_int : int -> t
-                      val to_int : t -> int
-                    end) = Defaults (
-  struct
-    type a = P.t
-	(* Format an integer using the following scheme:
-	   
-	   The lower 7 bits of each byte are used to store successive 7-bit
-	   chunks of the integer.
-	   
-	   The highest bit of each byte is used as a flag to indicate
-	   whether the next byte is present.
-	*)
-    open Buffer
-    open Char
-    open P
-
-    let to_buffer buffer =
-      let rec aux int =
-        (* are there more than 7 bits? *)
-        if logand int (lognot (of_int 0x7f)) <> zero
-        (* if there are, write the lowest 7 bite plus a high bit (to
-           indicate that there's more).  Then recurse, shifting the value
-           7 bits right *)
-        then begin
-          add_char buffer (chr (to_int (logor (of_int 0x80) (logand int (of_int 0x7f)))));
-	  aux (shift_right_logical int 7)
-        end
-          (* otherwise, write the bottom 7 bits only *)
-        else add_char buffer (chr (to_int int))
-      in aux
-
-    and from_stream stream = 
-      let rec aux (int : t) shift = 
-        let c = of_int (code (Stream.next stream)) in
-        let int = logor int (shift_left (logand c (of_int 0x7f)) shift) in
-          if logand c (of_int 0x80) <> zero then aux int (shift + 7)
-          else int 
-      in aux zero 0
-  end
-)
-
-module Dump_int32 = Dump_intN (Int32)
-module Dump_int64 = Dump_intN (Int64)
-module Dump_nativeint = Dump_intN (Nativeint)
-module Dump_int = Defaults (
-  struct
-    type a = int
-    let to_buffer buffer int = Dump_nativeint.to_buffer buffer (Nativeint.of_int int)
-    and from_stream stream = Nativeint.to_int (Dump_nativeint.from_stream stream)
-  end
-)
-
-module Dump_char = Defaults (
-  struct
-    type a = char
-    let to_buffer = Buffer.add_char
-    and from_stream = Stream.next
-  end
-)
-
-(* This is questionable; it doesn't preserve sharing *)
-module Dump_string = Defaults (
-  struct
-    type a = string
-    let to_buffer buffer string = 
-      begin
-        Dump_int.to_buffer buffer (String.length string);
-        Buffer.add_string buffer string
-      end
-    and from_stream stream = 
-      let len = Dump_int.from_stream stream in
-      let s = String.create len in
-        for i = 0 to len - 1 do
-          String.set s i (Stream.next stream) (* could use String.unsafe_set here *)
-        done;
-        s
-  end
-)
-
-module Dump_float = Defaults (
-  struct
-    type a = float
-    let to_buffer buffer f = Dump_int64.to_buffer buffer (Int64.bits_of_float f)
-    and from_stream stream = Int64.float_of_bits (Dump_int64.from_stream stream)
-  end
-)
-
-(* This should end up a bit more compact than the derived version *)
-module Dump_list (P : SimpleDump) = Defaults (
-  (* This could perhaps be more efficient by serialising the list in
-     reverse: this would result in only one traversal being needed
-     during serialisation, and no "reverse" being needed during
-     deserialisation.  (However, dumping would no longer be
-     tail-recursive) *)
-  struct
-    type a = P.a list
-    let to_buffer buffer items = 
-      begin
-        Dump_int.to_buffer buffer (List.length items);
-        List.iter (P.to_buffer buffer) items
-      end
-    and from_stream stream = 
-      let rec aux items = function
-        | 0 -> items
-        | n -> aux (P.from_stream stream :: items) (n-1)
-      in List.rev (aux [] (Dump_int.from_stream stream))
-  end
-)
-
-(* Dump_ref and Dump_array cannot preserve sharing, so we don't
-   provide implementations *)
-
-module Dump_option (P : SimpleDump) = Defaults (
-  struct
-    type a = P.a option
-    let to_buffer buffer = function
-      | None   -> Dump_int.to_buffer buffer 0
-      | Some s -> 
-          begin
-            Dump_int.to_buffer buffer 1;
-            P.to_buffer buffer s
-          end
-    and from_stream stream = 
-      match Dump_int.from_stream stream with
-        | 0 -> None
-        | 1 -> Some (P.from_stream stream)
-        | i      -> bad_tag i stream "option"
-  end
-)
-
-
-module Dump_bool = Defaults (
-  struct
-    type a = bool
-    let to_buffer buffer = function
-      | false -> Buffer.add_char buffer '\000'
-      | true  -> Buffer.add_char buffer '\001'
-    and from_stream stream =
-      match Stream.next stream with
-        | '\000' -> false
-        | '\001' -> true
-        | c      -> bad_tag (Char.code c) stream "bool"
-  end
-)
-
-module Dump_unit = Defaults (
-  struct
-    type a = unit
-    let to_buffer _ () = ()
-    and from_stream _ = ()
-  end
-)
-
-module Dump_alpha(P: sig type a end) = Defaults(struct
-  type a = P.a
-  let to_buffer _ _ = assert false
-  let from_stream _ = assert false
-end)
-
-module Dump_undumpable (P : sig type a val tname : string end) = Defaults ( 
-  struct 
-    type a = P.a
-    let to_buffer _ _ = failwith ("Dump: attempt to serialise a value of unserialisable type : " ^ P.tname)
-    let from_stream _ = failwith ("Dump: attempt to deserialise a value of unserialisable type : " ^ P.tname)
-  end
-)
-
-(* Uses Marshal to serialise the values that the parse-the-declarations
-   technique can't reach. *)
-module Dump_via_marshal (P : sig type a end) = Defaults (
-(* Rather inefficient. *)
-  struct
-    include P
-    let to_buffer buffer obj = Buffer.add_string buffer (Marshal.to_string obj [Marshal.Closures])
-    let from_stream stream = 
-      let readn n = 
-        let s = String.create n in
-          for i = 0 to n - 1 do
-            String.set s i (Stream.next stream)
-          done;
-          s
-      in
-      let header = readn Marshal.header_size in
-      let datasize = Marshal.data_size header 0 in
-      let datapart = readn datasize in
-        Marshal.from_string (header ^ datapart) 0
-  end)

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Dump.mli

-module type Dump =
-  sig
-    type a
-    val to_buffer : Buffer.t -> a -> unit
-    val to_string : a -> string
-    val to_channel : out_channel -> a -> unit
-    val from_stream : char Stream.t -> a
-    val from_string : string -> a
-    val from_channel : in_channel -> a
-  end
-
-module Defaults
-  (P : sig
-     type a
-     val to_buffer : Buffer.t -> a -> unit
-     val from_stream : char Stream.t -> a
-   end) : Dump with type a = P.a
-
-exception Dump_error of string
-
-module Dump_int32     : Dump with type a = Int32.t
-module Dump_int64     : Dump with type a = Int64.t
-module Dump_nativeint : Dump with type a = Nativeint.t
-module Dump_int       : Dump with type a = int
-module Dump_char      : Dump with type a = char
-module Dump_string    : Dump with type a = string
-module Dump_float     : Dump with type a = float
-module Dump_bool      : Dump with type a = bool
-module Dump_unit      : Dump with type a = unit
-module Dump_list   (P : Dump) : Dump with type a = P.a list
-module Dump_option (P : Dump) : Dump with type a = P.a option
-
-module Dump_undumpable (P : sig type a val tname : string end)
-  : Dump with type a = P.a
-module Dump_via_marshal (P : sig type a end)
-  : Dump with type a = P.a
-module Dump_alpha (P : sig type a end)
-  : Dump with type a = P.a

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Enum.ml

-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-open Deriving_Bounded
-
-let rec rassoc (rkey : 'b) : ('a * 'b) list -> 'a = function
-  | []                     -> raise Not_found
-  | (a,b)::_ when b = rkey -> a
-  | _::xs                  -> rassoc rkey xs
-
-let rec last : 'a list -> 'a = function
-    | []    -> raise (Invalid_argument "last")
-    | [x]   -> x
-    | _::xs -> last xs
-
-module Deriving_Enum =
-struct
-(** Enum **)
-module type Enum = sig
-  type a
-  val succ : a -> a
-  val pred : a -> a
-  val to_enum : int -> a
-  val from_enum : a -> int
-  val enum_from : a -> a list
-  val enum_from_then : a -> a -> a list
-  val enum_from_to : a -> a -> a list
-  val enum_from_then_to : a -> a -> a -> a list
-end
-
-let startThenTo (start : int) (next : int) (until : int) : int list = 
-  let step = next - start in
-    if step <= 0 then invalid_arg "startThenTo" 
-    else
-      let rec upFrom current =
-        if current > until then []
-        else current :: upFrom (current+step)
-      in
-        upFrom start
-
-let range : int -> int -> int list 
-  = fun f t -> startThenTo f (f+1) t
-
-module Defaults 
-  (E : (sig
-          type a
-          val numbering : (a * int) list
-        end)) : Enum with type a = E.a =
-struct
-  let firstCon = fst (List.hd E.numbering)
-  let lastCon = fst (last E.numbering)
-
-  type a = E.a
-  let from_enum a = List.assoc a E.numbering
-  let to_enum i = try rassoc i E.numbering with Not_found -> raise (Invalid_argument "to_enum")
-  let succ s = try to_enum ((from_enum s) + 1) with Invalid_argument "to_enum" -> raise (Invalid_argument "succ")
-  let pred s = try to_enum ((from_enum s) - 1) with Invalid_argument "to_enum" -> raise (Invalid_argument "pred")
-  let enum_from_to x y = List.map to_enum (range (from_enum x) (from_enum y))
-  let enum_from_then_to x y z = List.map to_enum (startThenTo (from_enum x) (from_enum y) (from_enum z))
-  let enum_from_then x y = (enum_from_then_to x y 
-                            (if from_enum y >= from_enum x then lastCon
-                             else firstCon))
-  let enum_from x = enum_from_to x lastCon
-end
-
-
-module Defaults' 
-  (E : (sig
-          type a
-          val from_enum : a -> int
-          val to_enum   : int -> a
-        end))
-  (B : Bounded with type a = E.a) : Enum with type a = E.a 
-                                         and  type a = B.a =
-struct
-  include E
-  let firstCon = B.min_bound
-  let lastCon = B.max_bound
-
-  let succ s = try to_enum ((from_enum s) + 1) with Invalid_argument "to_enum" -> raise (Invalid_argument "succ")
-  let pred s = try to_enum ((from_enum s) - 1) with Invalid_argument "to_enum" -> raise (Invalid_argument "pred")
-  let enum_from_to x y = List.map to_enum (range (from_enum x) (from_enum y))
-  let enum_from_then_to x y z = List.map to_enum (startThenTo (from_enum x) (from_enum y) (from_enum z))
-  let enum_from_then x y = (enum_from_then_to x y 
-                            (if from_enum y >= from_enum x then lastCon
-                             else firstCon))
-  let enum_from x = enum_from_to x lastCon
-end
-
-module Enum_bool = Defaults(struct
-  type a = bool
-  let numbering = [false, 0; true, 1]
-end)
-
-module Enum_char = Defaults'(struct
-  type a = char
-  let from_enum = Char.code
-  let to_enum = Char.chr
-end) (Bounded_char)
-
-module Enum_int = Defaults' (struct
-  type a = int
-  let from_enum i = i
-  let to_enum i = i
-end)(Bounded_int)
-
-(* Can `instance Enum Float' be justified?
-   For some floats `f' we have `succ f == f'. 
-   Furthermore, float is wider than int, so from_enum will necessarily
-   give nonsense on many inputs. *)
-
-module Enum_unit = Defaults' (struct
-  type a = unit
-  let from_enum () = 0
-  let to_enum = function
-    | 0 -> ()
-    | _ -> raise (Invalid_argument "to_enum")
-end) (Bounded_unit)
-end
-include Deriving_Enum
-
-type open_flag = Pervasives.open_flag  =
-                 | Open_rdonly
-                 | Open_wronly
-                 | Open_append
-                 | Open_creat
-                 | Open_trunc
-                 | Open_excl
-                 | Open_binary
-                 | Open_text
-                 | Open_nonblock
-                     deriving (Bounded,Enum)
-
-type fpclass = Pervasives.fpclass =
-               | FP_normal
-               | FP_subnormal
-               | FP_zero
-               | FP_infinite
-               | FP_nan
-                   deriving (Bounded,Enum)

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Enum.mli

-module type Enum =
-  sig
-    type a
-    val succ : a -> a
-    val pred : a -> a
-    val to_enum : int -> a
-    val from_enum : a -> int
-    val enum_from : a -> a list
-    val enum_from_then : a -> a -> a list
-    val enum_from_to : a -> a -> a list
-    val enum_from_then_to : a -> a -> a -> a list
-  end
-
-module Defaults
-  (E : sig type a val numbering : (a * int) list end)
-  : Enum with type a = E.a
-
-module Defaults' 
-  (E : sig type a val from_enum : a -> int val to_enum : int -> a end) 
-  (B : Deriving_Bounded.Bounded with type a = E.a)
-  : Enum with type a = B.a
-
-module Enum_bool : Enum with type a = bool
-module Enum_char : Enum with type a = char
-module Enum_int  : Enum with type a = int
-module Enum_unit : Enum with type a = unit

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Eq.ml

-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-module type Eq =
-sig
-  type a
-  val eq : a -> a -> bool
-end
-
-module Eq_immutable(S : sig type a end) :
-  Eq with type a = S.a =
-struct
-  type a = S.a
-  let eq = (=)
-end
-
-module Eq_mutable(S : sig type a end) :
-  Eq with type a = S.a =
-struct
-  type a = S.a
-  let eq = (==)
-end
-
-module Eq_alpha(S : sig type a end) = struct type a = S.a let eq _ _ = assert false end
-module Eq_int = Eq_immutable(struct type a = int end)
-module Eq_bool = Eq_immutable(struct type a = bool end)
-module Eq_float = Eq_immutable(struct type a = float end)
-module Eq_unit = Eq_immutable(struct type a = unit end)
-module Eq_char = Eq_immutable(struct type a = char end)
-module Eq_int32 = Eq_immutable(struct type a = int32 end)
-module Eq_int64 = Eq_immutable(struct type a = int64 end)
-module Eq_nativeint = Eq_immutable(struct type a = nativeint end)
-
-module Eq_string = Eq_mutable(struct type a = string end)
-module Eq_ref (E : Eq) = Eq_mutable(struct type a = E.a ref end)
-module Eq_array (E : Eq) = Eq_mutable(struct type a = E.a array end)
-
-module Eq_option (E : Eq) 
-  : Eq with type a = E.a option =
-struct 
-  type a = E.a option
-  let eq l r = match l, r with
-    | None, None -> true
-    | Some l, Some r -> E.eq l r
-    | _ -> false
-end
-
-module Eq_map_s_t (E : Eq) (M : Map.S)
-  : Eq with type a = E.a M.t =
-struct
-  type a = E.a M.t
-  let eq = M.equal (E.eq)
-end  
-
-module Eq_list (E : Eq) :
-  Eq with type a = E.a list =
-struct
-  type a = E.a list
-  let rec eq l r = match l, r with
-    | [], [] -> true
-    | (lfst::lrst), (rfst::rrst) when E.eq lfst rfst -> eq lrst rrst
-    | _ -> false
-end
-

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Eq.mli

-(* A module for SML-style equality, i.e. where equality of mutables is
-   physical equality and equality of immutables is structural equality.
-*)
-
-module type Eq =
-sig
-  type a
-  val eq : a -> a -> bool
-end
-
-module Eq_immutable (S : sig type a end) : Eq with type a = S.a
-module Eq_mutable (S : sig type a end) : Eq with type a = S.a
-
-module Eq_alpha(S : sig type a end) : Eq with type a = S.a
-module Eq_int            : Eq with type a = int
-module Eq_bool           : Eq with type a = bool
-module Eq_float          : Eq with type a = float
-module Eq_unit           : Eq with type a = unit
-module Eq_char           : Eq with type a = char
-module Eq_string         : Eq with type a = string
-module Eq_int32          : Eq with type a = int32
-module Eq_int64          : Eq with type a = int64
-module Eq_nativeint      : Eq with type a = nativeint
-module Eq_ref (E : Eq)   : Eq with type a = E.a ref
-module Eq_array (E : Eq) : Eq with type a = E.a array
-module Eq_list (E : Eq)  : Eq with type a = E.a list
-module Eq_option (E : Eq): Eq with type a = E.a option
-module Eq_map_s_t (E : Eq) (M : Map.S) : Eq with type a = E.a M.t

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Functor.ml

-open Deriving_monad
-
-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-module type Functor = 
-sig
-  type 'a f
-  val map : ('a -> 'b) -> 'a f -> 'b f
-end
-
-module MonadFunctor (M : Monad) 
-  : Functor with type 'a f = 'a M.m
-=
-struct
-  open M
-  type 'a f = 'a M.m
-  let map  f x = x >>= (fun x -> return (f x))
-end
-
-
-module Functor_option = MonadFunctor(Monad_option)
-module Functor_list = MonadFunctor(Monad_list)
-
-module Functor_map (O : Map.OrderedType) 
-  : Functor with type 'a f = 'a Map.Make(O).t =
-struct 
-  include Map.Make(O)
-  type 'a f = 'a t
-end
-
-(*
-NB: Instances for mutable types (including
-
-   ref
-   queue
-   stack
-   array
-   stream
-   buffer)
-
-are deliberately omitted.  Since sharing is detectable for values of
-these types we have two distinct design choices:
-
-  1. Always create a new copy that shares no structure with the
-     original.
-
-  2. Always mutate the original copy
-
-Neither of these seems like the right thing to do, so instead we
-simply don't handle mustable types at all.
-
-(Lazy.t is another example: we'd like map to be total and side-effect
-free, which is impossible to guarantee if we handle lazy.
-*)

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Functor.mli

-module type Functor = 
-sig
-  type 'a f
-  val map : ('a -> 'b) -> 'a f -> 'b f 
-end
-module MonadFunctor (M : Deriving_monad.Monad) : Functor with type 'a f = 'a M.m
-module Functor_option : Functor with type 'a f = 'a option
-module Functor_list : Functor with type 'a f = 'a list
-module Functor_map (O : Map.OrderedType) : Functor with type 'a f = 'a Map.Make(O).t

File deriving-ocsigen/hnrgrgr-deriving-3a21a27/lib/deriving_Pickle.ml

-(* Copyright Jeremy Yallop 2007.
-   This file is free software, distributed under the MIT license.
-   See the file COPYING for details.
-*)
-
-(*
-  Idea: