Commits

camlspotter  committed 91b00d0

updated to the new spotlib monad interface

  • Participants
  • Parent commits 78b93ea

Comments (0)

Files changed (6)

 OCAML_BYTE_LINK_FLAGS +=
 OCAML_NATIVE_LINK_FLAGS +=
 
-Subdirs()
+if $(file-exists ocaml/ocaml)
+  Subdirs()
+else
+  Subdirs_except(ocaml)
 #     linkopts
 #         C library link option (without OCaml -cclib options)    
 #
+#  You can specify MyOCamlPackageExtras before using this function to install files out of the scope of this rule.   
+#
 #  Example::
 #
 #      MyOCamlPackage(foo, alpha beta, $(EMPTY), $(EMPTY))
   CMA=$(library_name).cma
   CMXA=$(library_name).cmxa
 
+  if $(not $(defined MyOCamlPackageExtras))
+      MyOCamlPackageExtras[]=
+      export
+
   CSTUBLIBRARIES=
   if $(not $(equal $(cmodules), $(EMPTY)))
       CSTUBLIBRARIES= dll$(library_name).so lib$(library_name).a 
   # CR jfuruse: I guess we do not need the following
   # export # export the implicit rule above
 
-  .DEFAULT: $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa
+  .DEFAULT: $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa $(MyOCamlPackageExtras)
 
   $(CMA) $(CMXA) $(library_name).a $(CSTUBLIBRARIES) : $(CSTUBS) $(CMOS) $(CMXS)
       ocamlmklib -verbose -o $(library_name) $(CSTUBS) $(linkopts) $(CMOS) $(CMXS)
   ## install
 
   # CR jfuruse: x.cmi is required if x.mli does not exist!
-  targets[]=META $(glob i, *.mli) $(library_name).cmi $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa $(library_name).o $(library_name).a $(CSTUBLIBRARIES)
+  targets[]=META $(glob i, *.mli) $(library_name).cmi $(library_name).cmo $(library_name).cmx $(library_name).cma $(library_name).cmxa $(library_name).o $(library_name).a $(CSTUBLIBRARIES) $(MyOCamlPackageExtras)
 
   if $(OCAML_SPOT)
     targets[]+= $(library_name).spot

File lib/pbase.ml

       wasted := !all_wasted
   end
 
+  type 'a t = Str.t -> ('a * Str.t, Str.Pos.t * string) Result.t
+
   include Monad.Make(struct 
 
     type 'a t = Str.t -> ('a * Str.t, error) Result.t

File lib/planck_intf.ml

     val recover_all : unit -> unit (* format will print the over all result *)
   end
 
-  include Monad_intf.T 
+  include Monad_intf.T
   (** Inherit monadic interface. ['a t] is a function, so \eta expandable *)
 
   (** Parser combinators *)

File lib/result.ml

 open Spotlib.Spot
 
-type ('a, 'error) _t =
+type ('a, 'error) t =
   | Ok of 'a
   | Error of 'error
 with sexp
 
 include Monad.Make2(struct
+  type ('a, 'error) _t = ('a, 'error) t (* stupid way of avoiding default rec of type *)
   type ('a, 'error) t = ('a, 'error) _t
   let return v = Ok v
   let bind v f = match v with

File lib/result.mli

 
 open Spotlib.Spot
 
-type ('a, 'error) _t = 
+type ('a, 'error) t = 
   | Ok of 'a
   | Error of 'error
 with sexp
 
-include Monad_intf.T2 with type ('a, 'error) t = ('a, 'error) _t
+include Monad_intf.T2 with type ('a, 'error) t := ('a, 'error) t
 
 val fail : 'error -> ('a, 'error) t