[from now] 2013/05/01 17:32:06

diff --git a/.gitignore b/.gitignore
index e109759..66096de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,15 @@
-*.cmo
-*.cmi
-*.cmt
-*.cmti
-*.annot
-*.cma
-*.cmx
-*.cmxa
-
-*.a
-*.o
-*.exe
-*.so
-
+*.cmo
+*.cmi
+*.cmt
+*.cmti
+*.annot
+*.cma
+*.cmx
+*.cmxa
+
+*.a
+*.o
+*.exe
+*.so
+
 *.omc
\ No newline at end of file
diff --git a/MyOMake/MyFunction.om b/MyOMake/MyFunction.om
index 6e9c0c7..749043e 100644
--- a/MyOMake/MyFunction.om
+++ b/MyOMake/MyFunction.om
@@ -1,46 +1,46 @@
-
-.PHONY: all install uninstall clean
-
-BIG_ROOT=$(dir .)
-
-# To enable the installation mark files, you must define INSTALLED path
-# variable for the mark file directory like INSTALLED=$(BIG_ROOT)/installed and
-# make sure the directory $(INSTALLED) exists. This preparation must be done outside
-# this file.
-Installed(packs) =
-	if $(defined INSTALLED)
-		return $(addprefix $(INSTALLED)/, $(packs))
-	else
-		return $(array)
-
-# Create $(Installed $(packed)) file from the digest of $(targets)
-CreateInstalled(pack, targets)=
-	if $(defined INSTALLED)
-		println(dump md5 $(INSTALLED)/$(pack))
-		CreateCheckSum($(INSTALLED)/$(pack), $(targets))
-
-RequireFiles(files) =
-    .SCANNER: scan-%: $(files)
-    % : $(files)
-    export
-
-CreateCheckSum(pack, targets) =
-    chan = $(fopen $(pack), w)
-    fprintln($(chan), $(string $(targets)))
-    fprintln($(chan), $(string $(digest $(targets))))
-    close($(chan))
-
-# Install clean command which cleans all the target files exists under
-# the directory. Use with care.
-AutoClean() =
-	.PHONY: clean
-	clean:
-		rm -f $(filter-proper-targets $(ls R, .))
-	export
-
-RequireBuild(targets) =
-    dependencies.md5: $(targets)
-        println($(string $(sequence-sort $(compare), $(dependencies-all $(targets)))))
-        CreateCheckSum($@, $(sequence-sort $(compare), $(dependencies-all $(targets))))
-    RequireFiles(dependencies.md5)
-    export
+
+.PHONY: all install uninstall clean
+
+BIG_ROOT=$(dir .)
+
+# To enable the installation mark files, you must define INSTALLED path
+# variable for the mark file directory like INSTALLED=$(BIG_ROOT)/installed and
+# make sure the directory $(INSTALLED) exists. This preparation must be done outside
+# this file.
+Installed(packs) =
+	if $(defined INSTALLED)
+		return $(addprefix $(INSTALLED)/, $(packs))
+	else
+		return $(array)
+
+# Create $(Installed $(packed)) file from the digest of $(targets)
+CreateInstalled(pack, targets)=
+	if $(defined INSTALLED)
+		println(dump md5 $(INSTALLED)/$(pack))
+		CreateCheckSum($(INSTALLED)/$(pack), $(targets))
+
+RequireFiles(files) =
+    .SCANNER: scan-%: $(files)
+    % : $(files)
+    export
+
+CreateCheckSum(pack, targets) =
+    chan = $(fopen $(pack), w)
+    fprintln($(chan), $(string $(targets)))
+    fprintln($(chan), $(string $(digest $(targets))))
+    close($(chan))
+
+# Install clean command which cleans all the target files exists under
+# the directory. Use with care.
+AutoClean() =
+	.PHONY: clean
+	clean:
+		rm -f $(filter-proper-targets $(ls R, .))
+	export
+
+RequireBuild(targets) =
+    dependencies.md5: $(targets)
+        println($(string $(sequence-sort $(compare), $(dependencies-all $(targets)))))
+        CreateCheckSum($@, $(sequence-sort $(compare), $(dependencies-all $(targets))))
+    RequireFiles(dependencies.md5)
+    export
diff --git a/MyOMake/MyOCaml.om b/MyOMake/MyOCaml.om
index acc5253..ad9678f 100644
--- a/MyOMake/MyOCaml.om
+++ b/MyOMake/MyOCaml.om
@@ -1,921 +1,921 @@
-open build/Common
-open configure/Configure
-open MyFunction
-
-public.USE_OCAMLFIND = false
-
-.STATIC:
-    OCAMLFIND_EXISTS = $(CheckProg ocamlfind)
-    OCAMLC_OPT_EXISTS = $(CheckProg ocamlc.opt)
-    OCAMLC_EXISTS = $(or $(OCAMLC_OPT_EXISTS), $(CheckProg ocamlc))
-    OCAMLOPT_OPT_EXISTS = $(CheckProg ocamlopt.opt)
-    OCAMLOPT_EXISTS = $(or $(OCAMLOPT_OPT_EXISTS), $(CheckProg ocamlopt))
-    ConfMsgChecking(whether ocamlc understands the "z" warnings)
-    OCAML_ACCEPTS_Z_WARNING =
-        if $(OCAMLC_EXISTS)
-            value $(ConfMsgYesNo $(shell-success-null ocamlc$(if $(OCAMLC_OPT_EXISTS), .opt) -w Az))
-        else
-            ConfMsgResult($"FAILED - ocamlc not found")
-            value false
-    OCAMLC = $(if $(OCAMLC_OPT_EXISTS), $`(if $(USE_OCAMLFIND), ocamlc, ocamlc.opt), ocamlc)
-    OCAMLOPT = $(if $(OCAMLOPT_OPT_EXISTS), $`(if $(USE_OCAMLFIND), ocamlopt, ocamlopt.opt), ocamlopt)
-    CAMLIDL_EXISTS = $(CheckProg camlidl)
-    #
-    # Compile native or byte code?
-    #
-    NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-    BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
-
-    # Debug build enable if defined DEBUG variable when --configure or first time of omake execution.
-    DEBUG_ENABLE = false
-    if $(and $(defined DEBUG), $(equal $(DEBUG), 1))
-        DEBUG_ENABLE = true
-        export
-
-public.CAMLIDL = $`(if $(CAMLIDL_EXISTS), camlidl)
-public.OCAMLFIND = $`(if $(USE_OCAMLFIND), ocamlfind)
-public.OCAMLFINDFLAGS =
-public.LAZY_OCAMLFINDFLAGS = $`(if $(USE_OCAMLFIND), $(OCAMLFINDFLAGS))
-
-public.OCAMLDEP = ocamldep
-public.CAMLP4 = camlp4
-public.OCAMLLEX = ocamllex
-public.OCAMLLEXFLAGS = -q
-public.OCAMLYACC = ocamlyacc
-public.OCAMLYACCFLAGS =
-public.OCAMLMKTOP = ocamlmktop
-public.OCAMLMKLIB = ocamlmklib
-public.OCAMLLINK = $`(OCAMLC)
-public.OCAMLOPTLINK = $`(OCAMLOPT)
-public.OCAMLDOC = ocamldoc
-
-#
-# Include path
-#
-public.OCAMLINCLUDES[] = .
-public.PREFIXED_OCAMLINCLUDES = $`(mapprefix -I, $(OCAMLINCLUDES))
-
-#
-# Packages
-#
-public.OCAMLPACKS[] =
-public.PREFIXED_OCAMLPACKS =\
-   $`(if $(and $(USE_OCAMLFIND) $(gt $(length $(OCAMLPACKS)), 0)),\
-         -package $(string $(concat \,, $(OCAMLPACKS))),\
-         $(EMPTY))
-
-#
-# Various options
-#
-declare OCAMLDEPFLAGS
-public.OCAMLPPFLAGS  =
-public.OCAMLFLAGS    = -warn-error A
-public.OCAMLCFLAGS   = $`(if $(DEBUG_ENABLE), -g)
-public.OCAMLOPTFLAGS =
-public.OCAMLCPPFLAGS =
-public.OCAML_LINK_FLAGS = $`(if $(and $(USE_OCAMLFIND) $(gt $(length $(OCAMLPACKS)), 0)), -linkpkg, $(EMPTY))
-public.OCAML_BYTE_LINK_FLAGS = -custom
-public.OCAML_NATIVE_LINK_FLAGS =
-# ocaml packaging option
-OCAML_PACKAGE_FLAG =
-
-public.LocalOCamlGeneratedFiles(files) =
-    if $(OCAMLDEP_MODULES_ENABLED)
-        # For now, we want to allow ``backwards-compatible'' projects.
-        # eprintln($"WARNING: OCamlGeneratedFiles should not be used when OCAMLDEP_MODULES_ENABLED")
-        # eprintln($"         is set")
-    else
-        .SCANNER: scan-ocaml-%: $(files)
-        .SCANNER: %.cmi: $(files)
-        .SCANNER: %.cmx %.cmo: $(files)
-        export
-    export
-
-#
-# OCAML_LIBS contains libraries that are used as dependencies
-# OCAML_OTHER_LIBS contains other libraries (like unix.cma)
-# The lists do not include suffixes.
-#
-# OCAML_LINK_FLAGS contains extra linking information
-#
-public.OCAML_LIBS =
-public.OCAML_CLIBS =
-public.OCAML_OTHER_LIBS =
-public.OCAML_LIB_FLAGS =
-
-########################################################################
-# As of OCaml version 3.09.2, the standard \verb+ocamldep+ scanner is ``broken''.  The main issue is
-# that it finds only those dependencies that already exist.  If \verb+foo.ml+ contains a dependency
-# on \verb+Bar+,
-#
-.STATIC:
-    OCAMLDEP_MODULES =
-    OCAMLDEP_MODULES_USE_OCAMLFIND = true
-    ConfMsgChecking(if ocamldep understands -modules)
-    OCAMLDEP_MODULES_AVAILABLE = $(ConfMsgYesNo $(shell-success-null ocamldep -modules))
-    if $(OCAMLDEP_MODULES_AVAILABLE)
-        OCAMLDEP_MODULES = ocamldep
-        export
-    else
-        ConfMsgChecking(for ocamldep-omake bytecode file)
-        OCAMLDEP_OMAKE = $(find-in-path-optional $(PATH), ocamldep-omake)
-        if $(OCAMLDEP_OMAKE)
-            OCAMLDEP_OMAKE = $(file $(OCAMLDEP_OMAKE))
-            ConfMsgResult(found $(absname $(OCAMLDEP_OMAKE)))
-
-            ConfMsgChecking(if ocamldep-omake runs)
-            OCAMLDEP_MODULES_AVAILABLE = $(ConfMsgYesNo $(shell-success-null ocamlrun $(OCAMLDEP_OMAKE) -modules))
-            OCAMLDEP_MODULES = $(if $(OCAMLDEP_MODULES_AVAILABLE), ocamlrun $(OCAMLDEP_OMAKE))
-            OCAMLDEP_MODULES_USE_OCAMLFIND = false
-            export
-        else
-            ConfMsgResult(NOT FOUND)
-        export OCAMLDEP_MODULES_AVAILABLE OCAMLDEP_MODULES OCAMLDEP_MODULES_USE_OCAMLFIND
-
-    OCAMLDEP_MODULES_ENABLED = $(OCAMLDEP_MODULES_AVAILABLE)
-
-public.OCAMLDEPFLAGS = $`(if $(and $(NATIVE_ENABLED), $(not $(OCAMLDEP_MODULES_ENABLED))), -native, $(EMPTY))
-
-# Print the dependencies for a ML file, based on the
-# .cmi files.
-#
-# If OCAMLDEP_PRESERVE_TARGETS is true, then the
-# ocamldep entries are taken literally (the suffix
-# is not replaced with .cmo/.cmx).
-#
-public.OCAMLDEP_PRESERVE_TARGETS = false
-
-public.PrintMLIDependencies(filename, cmideps) =
-    if $(cmideps)
-        private.base = $(string-escaped $(removesuffix $(filename)))
-        println($"""$(base).cmi: $(string-escaped $(cmideps))""")
-
-public.PrintMLDependencies(filename, cmideps, cmxdeps) =
-    private.base = $(string-escaped $(removesuffix $(filename)))
-    private.esc = $' \'
-    private.text =
-    if $(cmideps)
-        cmideps = $(string-escaped $(cmideps))
-        private.text = $"""
-$(base).cmo: $(cmideps)
-$(base).cmx $(base)$(EXT_OBJ):$(esc)
-    $(cmideps)"""
-        export text
-    if $(cmxdeps)
-        private.odeps = $(string-escaped $(addsuffix $(EXT_OBJ), $(removesuffix $(cmxdeps))))
-        if $(not $(text))
-            text = $"""$(base).cmx $(base)$(EXT_OBJ):"""
-            export
-        text += $"""$(esc)
-    $(string-escaped $(cmxdeps))$(esc)
-    $(odeps)"""
-        export text
-    # eprintln($(text))
-    println($(text))
-
-public.PrintFileDependencies(filename, cmideps) =
-    if $(cmideps)
-        private.text = $"""$(string-escaped $(filename)): $(string-escaped $(cmideps))"""
-        # eprintln($(text))
-        println($(text))
-
-#
-# Given a set of literal dependencies, compute
-# the actual dependencies by finding the filenames
-# associated with each module.
-#
-public.PrintDependencies(filename, modules) =
-    if $(filename)
-        #
-        # Find the .cmi files that can be built
-        #
-        private.cmideps = $(find-ocaml-targets-in-path-optional $(OCAMLINCLUDES), $(addsuffix .cmi, $(modules)))
-
-        # Now produce the dependencies
-        if $(OCAMLDEP_PRESERVE_TARGETS)
-            PrintFileDependencies($(filename), $(cmideps))
-        else
-            switch($(suffix $(filename)))
-            case .ml
-                protected.cmxdeps[] =
-                if $(NATIVE_ENABLED)
-                    cmxdeps = $(find-ocaml-targets-in-path-optional $(OCAMLINCLUDES), $(addsuffix .cmx, $(modules)))
-                    export
-                PrintMLDependencies($(filename), $(cmideps), $(cmxdeps))
-            case .mli
-                PrintMLIDependencies($(filename), $(cmideps))
-            default
-                eprintln($"ocaml scanner: illegal filename $(filename)")
-                exit(1)
-
-#
-# Post-process the output of ocamldep.
-# Use awk to process the input, find the targets that
-# exist, and then print the dependencies.
-#
-public.OCamlScannerPostproc() =
-    #
-    # Read the module names from the standard input
-    #
-    protected.filename =
-    protected.modules[] =
-    awk(b, $(stdin))
-    case $'^\(.*\):[[:space:]]*\(.*\)$'
-        PrintDependencies($(filename), $(modules))
-        filename = $1
-        modules[] = $(split $' ', $2)
-        export
-    case $'^	\(.*\)'
-        # Add the dependency
-        modules[] += $1
-        export
-    default
-        eprintln(Unrecognized ocamldep output: $0)
-    PrintDependencies($(filename), $(modules))
-
-Shell. +=
-    ocamldep-postproc(argv) =
-        if $(mem -preserve-targets, $(argv))
-           OCAMLDEP_PRESERVE_TARGETS = true
-           export
-        OCamlScannerPostproc()
-
-public.OCamlScanner(src_file) =
-    if $(OCAMLDEP_MODULES_ENABLED)
-        if $(OCAMLDEP_MODULES_USE_OCAMLFIND)
-            value $(OCAMLFIND) $(OCAMLDEP_MODULES) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLDEPFLAGS) -modules $(src_file) | ocamldep-postproc
-        else
-            value $(OCAMLDEP_MODULES) $(OCAMLDEPFLAGS) -modules $(src_file) | ocamldep-postproc
-    else
-        value $(OCAMLFIND) $(OCAMLDEP) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLDEPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(src_file)
-
-#
-# Generic scanners
-#
-OCamlScannerTargets(files) =
-    files[] = $(basename $(files))
-    files[] = $(if $(NATIVE_ENABLED), $(files), $(filter-out %.cmx, $(files)))
-    files[] = $(if $(BYTE_ENABLED), $(files), $(filter-out %.cmo, $(files)))
-    value $(find-targets-in-path-optional $(OCAMLINCLUDES), $(files)) $(NATIVE_ENABLED) $(BYTE_ENABLED)
-
-.SCANNER: scan-ocaml-%.mli: %.mli /.PHONY/OCamlGeneratedFilesTarget :value: $(OCamlScannerTargets $&)
-    $(OCamlScanner $<)
-
-.SCANNER: scan-ocaml-%.ml: %.ml /.PHONY/OCamlGeneratedFilesTarget :exists: %.mli :value: $(OCamlScannerTargets $&)
-    $(OCamlScanner $<)
-
-#
-# Default .SCANNER rules for backwards-compatibility.
-#
-.SCANNER: %.cmi: %.mli /.PHONY/OCamlGeneratedFilesTarget :value: $(OCamlScannerTargets $&)
-    $(OCamlScanner $<)
-
-.SCANNER: %.cmx %.cmo %$(EXT_OBJ): %.ml /.PHONY/OCamlGeneratedFilesTarget :exists: %.mli :value: $(OCamlScannerTargets $&)
-    $(OCamlScanner $<)
-
-#
-# Define a link order for OCaml files.
-# If a file depends on a %.cmi, it also depends on %.cmo
-#
-.ORDER: .OCAMLLINK
-
-.OCAMLLINK: %.cmi: %.cmo
-.OCAMLLINK: %.cmx: %.cmo
-
-public.ABORT_ON_DEPENDENCY_ERRORS = false
-
-OCamlLinkSort(nodes) =
-   if $(ABORT_ON_DEPENDENCY_ERRORS)
-      value $(file-check-sort .OCAMLLINK, $(nodes))
-   else
-      value $(file-sort .OCAMLLINK, $(nodes))
-
-
-# generic OCaml compile function.
-public.OCamlC() =
-    value $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
-              $(OCAMLCFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(OCAML_PACKAGE_FLAG)
-
-public.OCamlOpt() =
-    value $(OCAMLFIND) $(OCAMLOPT) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
-              $(OCAMLOPTFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(OCAML_PACKAGE_FLAG)
-
-%.ml : %.mll
-    $(OCAMLLEX) $(OCAMLLEXFLAGS) $<
-
-
-########################################################################
-# Parser generators
-#
-
-#
-# You can choose to use ocamlyacc or menhir for a parser
-# generator.  The default is ocamlyacc.  Define the
-# MENHIR_ENABLED as true if you would rather use menhir.
-#
-# Variables:
-#    MENHIR : the name of the menhir executable
-#    MENHIR_FLAGS : any additional options to pass to Menhir
-#    MENHIR_AVAILABLE : the menhir executable is installed
-#    MENHIR_RAW_DEPEND : menhir supports the --raw-depend option
-#
-public.MENHIR = menhir
-public.MENHIR_FLAGS =
-public.MENHIR_ENABLED = false
-.STATIC:
-    MENHIR_AVAILABLE = $(CheckProg $(MENHIR))
-    MENHIR_RAW_DEPEND = false
-    if $(MENHIR_AVAILABLE)
-        ConfMsgChecking(if $(MENHIR) supports the --raw-depend option)
-        MENHIR_RAW_DEPEND = $(ConfMsgYesNo $(shell-success-null $(MENHIR) -help | grep $'^ *--raw-depend'))
-        export
-
-# Menhir is being requested.  Check that it is installed.
-public.MenhirCheck() =
-    if $(not $(MENHIR_AVAILABLE))
-       eprintln($"""!!! You are asking to use Menhir, but it is not installed.""")
-       eprintln($"""!!! See the Menhir home page for instructions on downloading.""")
-       eprintln($"""!!!    http://cristal.inria.fr/~fpottier/menhir/""")
-       exit(1)
-
-# Compute the correct ocamlc and ocamldep options for Menhir.
-public.MenhirOCamlcCommand() =
-    MenhirCheck()
-    private.ocamlc[] =\
-       $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
-           $(OCAMLCFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES)
-    value --ocamlc $(quote-argv $(ocamlc))
-
-public.MenhirOCamldepCommand(raw) =
-    ocamldep =
-       if $(raw)
-           value $(OCAMLDEP) -modules $(OCAMLDEPFLAGS)
-       else
-           value $(OCAMLDEP) $(PREFIXED_OCAMLINCLUDES) $(OCAMLDEPFLAGS)
-    value --ocamldep $(quote-argv $(ocamldep))
-
-# Compute the Mendir dependency scanner command
-public.MenhirScannerCommand(base, src) =
-    if $(MENHIR_ENABLED)
-        if $(and $(MENHIR_RAW_DEPEND), $(OCAMLDEP_MODULES_ENABLED))
-            value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamldepCommand true) $(base) --raw-depend $(src) | ocamldep-postproc -preserve-targets
-        else
-            value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamldepCommand false) $(base) --depend $(src)
-
-# Use Menhir if MENHIR_ENABLED, ocamlyacc otherwise
-public.OCamlYaccCommand(src) =
-    if $(MENHIR_ENABLED)
-        value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamlcCommand) $(src)
-    else
-        value $(OCAMLYACC) $(OCAMLYACCFLAGS) $(src)
-
-.SCANNER: scan-ocamlyacc-%.mly: %.mly :value: $(MENHIR_ENABLED) $(OCamlScannerTargets $&)
-    $(MenhirScannerCommand $(EMPTY), $<)
-
-%.ml %.mli: %.mly :scanner: scan-ocamlyacc-%.mly
-    $(OCamlYaccCommand $<)
-
-#
-# \begin{doc}
-# \subsection{Using the Menhir parser generator}
-#
-# Menhir is a parser generator that is mostly compatible with
-# \verb+ocamlyacc+, but with many improvements.  A few of these
-# are listed here (excerpted from the Menhir home page
-# \url{http://cristal.inria.fr/~fpottier/menhir/}).
-#
-# \begin{itemize}
-# \item Menhir's explanations are believed to be understandable by mere humans.
-# \item Menhir allows grammar specifications to be split over multiple files.
-#     It also allows several grammars to share a single set of tokens.
-# \item Menhir is able to produce parsers that are parameterized by Objective Caml modules.
-# \item [Added by jyh] With the \verb+--infer+ option, Menhir can typecheck the semantic actions
-#    in your grammar at \emph{generation} time.
-# \end{itemize}
-#
-# What do you need to do to use Menhir instead of \verb+ocamlyacc+?
-# \begin{enumerate}
-# \item Place the following definition before the relevant section of your project
-#    (or at the top of your project \verb+OMakefile+ if you want to use Menhir everywhere).
-#
-# \begin{verbatim}
-#    MENHIR_ENABLED = true
-# \end{verbatim}
-#
-# \item Optionally, add any desired Menhir options to the \verb+MENHIR_FLAGS+ variable.
-#
-# \begin{verbatim}
-#    MENHIR_FLAGS += --infer
-# \end{verbatim}
-# \end{enumerate}
-#
-# With this setup, any file with a \verb+.mly+ suffix will be compiled with Menhir.
-#
-# If your grammar is split across several files, you need to specify it explicitly,
-# using the \verb+MenhirMulti+ function.
-#
-# \begin{verbatim}
-#     MenhirMulti(target, sources)
-#         target : filename, without suffix
-#         sources : the files that define the grammar, without suffixes
-# \end{verbatim}
-#
-# For example, if you want to generate the parser files \verb+parse.ml+ and \verb+parse.mli+,
-# from the grammar specified in files \verb+a.mly+ and \verb+b.mly+, you would use
-# the following.
-#
-# \begin{verbatim}
-#     MenhirMulti(parse, a b)
-# \end{verbatim}
-# \end{doc}
-#
-public.MenhirMulti(target, sources) =
-    MenhirCheck()
-    sources = $(addsuffix .mly, $(sources))
-
-    # Menhir needs all the files for dependency analysis
-    .SCANNER: scan-menhir-$(target).multi: $(sources) :value: $(OCamlScannerTargets $&)
-        $(MenhirScannerCommand --base $(target), $+)
-
-    # Set up the actual rule
-    $(target).ml $(target).mli: $(sources) :scanner: scan-menhir-$(target).multi
-        $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamlcCommand) --base $(target) $+
-
-%.cmx : %.ml
-    section rule
-        if $(not $(NATIVE_ENABLED))
-            err. =
-                extends $(UnbuildableException)
-                message = $(string $"You are trying to build OCaml native code file: "%.cmx$"
-However, the NATIVE_ENABLED flag is not set.
-Include the following definition in your OMakefile
-if you really want to build this file.
-       NATIVE_ENABLED = true")
-                target = $(file %.cmx)
-            raise $(err)
-        elseif $(target-exists %.mli)
-            %.cmx %$(EXT_OBJ): %.ml %.cmi :scanner: scan-ocaml-%.ml
-                $(OCamlOpt) -c $<
-        elseif $(BYTE_ENABLED)
-            %.cmx %.cmi %$(EXT_OBJ) %.cmo: %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlC) -c $<
-                $(OCamlOpt) -c $<
-        else
-            %.cmx %.cmi %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlOpt) -c $<
-
-%$(EXT_OBJ): %.ml
-    section rule
-        if $(not $(NATIVE_ENABLED))
-            err. =
-                extends $(UnbuildableException)
-                message = $(string $"You are trying to build OCaml native code file: "%$(EXT_OBJ)$"
-However, the NATIVE_ENABLED flag is not set.
-Include the following definition in your OMakefile
-if you really want to build this file.
-       NATIVE_ENABLED = true")
-                target = $(file %.cmx)
-            raise $(err)
-        elseif $(target-exists %.mli)
-            %$(EXT_OBJ) %.cmx: %.ml %.cmi :scanner: scan-ocaml-%.ml
-                $(OCamlOpt) -c $<
-        elseif $(BYTE_ENABLED)
-            %$(EXT_OBJ) %.cmi %.cmx %.cmo: %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlC) -c $<
-                $(OCamlOpt) -c $<
-        else
-            %$(EXT_OBJ) %.cmi %.cmx: %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlOpt) -c $<
-
-%.cmo: %.ml
-    section rule
-        if $(not $(BYTE_ENABLED))
-            err. =
-                extends $(UnbuildableException)
-                message = $(string $"You are trying to build OCaml native code file: "%.cmo$"
-However, the BYTE_ENABLED flag is not set.
-Include the following definition in your OMakefile
-if you really want to build this file.
-       BYTE_ENABLED = true")
-                target = $(file %.cmx)
-            raise $(err)
-        elseif $(target-exists %.mli)
-            %.cmo: %.ml %.cmi :scanner: scan-ocaml-%.ml
-                $(OCamlC) -c $<
-        elseif $(NATIVE_ENABLED)
-            %.cmo %.cmi %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlC) -c $<
-                $(OCamlOpt) -c $<
-        else
-            %.cmo %.cmi: %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlC) -c $<
-
-%.cmi: %.ml
-    section rule
-        if $(BYTE_ENABLED)
-            if $(NATIVE_ENABLED)
-                %.cmi %.cmo %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
-                    $(OCamlC) -c $<
-                    $(OCamlOpt) -c $<
-            else
-                %.cmi %.cmo: %.ml :scanner: scan-ocaml-%.ml
-                    $(OCamlC) -c $<
-        else
-            %.cmi %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
-                $(OCamlOpt) -c $<
-
-%.cmi: %.mli
-    $(OCamlC) -c $<
-
-%.cmti: %.mli
-    $(OCamlC) -c $<
-
-%.cmt: %.ml
-    $(OCamlC) $<
-
-%.annot: %.ml
-    $(OCamlC) $<
-
-# build rules
-# ======================================================================
-
-public.OCamlProgram(name, files) =
-   # XXX: JYH: these variables should be marked private in 0.9.9
-   protected.CMOFILES  = $(addsuffix .cmo, $(files))
-   protected.CMXFILES  = $(addsuffix .cmx, $(files))
-   protected.OFILES    = $(addsuffix $(EXT_OBJ), $(files))
-
-   protected.CMAFILES  = $(addsuffix .cma,  $(OCAML_LIBS))
-   protected.CMXAFILES = $(addsuffix .cmxa, $(OCAML_LIBS))
-   protected.ARFILES   = $(addsuffix $(EXT_LIB), $(OCAML_LIBS))
-   protected.CMA_OTHER_FILES = $(addsuffix .cma, $(OCAML_OTHER_LIBS))
-   protected.CMXA_OTHER_FILES = $(addsuffix .cmxa, $(OCAML_OTHER_LIBS))
-
-   protected.CLIBS = $(addsuffix $(EXT_LIB), $(OCAML_CLIBS))
-
-   protected.name = $(file $(name))
-
-   protected.PROG     = $(file $(name)$(EXE))
-   protected.BYTEPROG = $(file $(name).run)
-   protected.OPTPROG  = $(file $(name).opt)
-
-   #
-   # Rules to build byte-code and native targets
-   #
-   $(BYTEPROG): $(CMAFILES) $(CMOFILES) $(CLIBS)
-        $(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLCFLAGS)\
-                $(PREFIXED_OCAMLINCLUDES) $(OCAML_BYTE_LINK_FLAGS)\
-                -o $@ $(CMA_OTHER_FILES) $(CMAFILES) $(OCamlLinkSort $(CMOFILES))\
-                $(CLIBS) $(OCAML_LINK_FLAGS)
-
-   $(OPTPROG): $(CMXAFILES) $(ARFILES) $(CMXFILES) $(OFILES) $(CLIBS)
-        $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS)\
-                $(PREFIXED_OCAMLINCLUDES) $(OCAML_NATIVE_LINK_FLAGS)\
-                -o $@ $(CMXA_OTHER_FILES) $(CMXAFILES) $(OCamlLinkSort $(CMXFILES))\
-                $(CLIBS) $(OCAML_LINK_FLAGS)
-
-   #
-   # Link the actual executables.
-   # Always prefer native executables.
-   #
-   if $(NATIVE_ENABLED)
-        $(PROG): $(OPTPROG)
-            ln-or-cp $< $@
-   else
-        $(PROG): $(BYTEPROG)
-            ln-or-cp $< $@
-
-   return $(array $(PROG), $(if $(NATIVE_ENABLED), $(OPTPROG)), $(if $(BYTE_ENABLED), $(BYTEPROG)))
-
-# Add rules to build OCaml library $(name)
-#    name
-#        name of the library
-#    files
-#        OCaml module names (without .ml)
-#
-#   .. note :: Probably you should use MyOCamlPackage
-MyOCamlLibrary(library, files) =
-   install-lib: $(OCamlLibrary $(library), $(files))
-   AutoClean()
-
-# build library with targets. this function returns between one and three file names.
-OCamlLibrary(library, targets) =
-    protected.name = $(file $(library))
-
-    protected.OFILES = $(addsuffix $(EXT_OBJ), $(targets))
-    protected.CMOFILES = $(addsuffix .cmo, $(targets))
-    protected.CMXFILES = $(addsuffix .cmx, $(targets))
-
-    protected.CLIB = $(file $(name)$(EXT_LIB))
-    protected.BYTELIB = $(file $(name).cma)
-    protected.NATIVELIB = $(file $(name).cmxa)
-
-    # Link commands
-    $(BYTELIB): $(CMOFILES)
-        $(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLCFLAGS) \
-                $(OCAML_LIB_FLAGS) -a -o $@ $(OCamlLinkSort $(CMOFILES))
-    $(NATIVELIB) $(CLIB): $(CMXFILES) $(OFILES)
-        $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) \
-                $(OCAML_LIB_FLAGS) -a -o $(NATIVELIB) $(OCamlLinkSort $(CMXFILES))
-    return $(array $(if $(NATIVE_ENABLED), $(NATIVELIB)), $(if $(NATIVE_ENABLED), $(CLIB)), $(if $(BYTE_ENABLED), $(BYTELIB)))
-
-# Get files which are made by MyOCamlPackage function.
-# files returned this function are targeted in MyOCamlPackage, then
-# it can be used as dependency for any target.
-#
-#    name
-#        target package name
-#    has_cmodule
-#        flag to have C modules for this package whether true or false.
-# Example:
-#    OCamlPackageTargetFiles(hoge, true)
-#
-public.OCamlPackageGeneratedFiles(name, has_cmodule) =
-    protected.OBJ       = $(file $(name)$(EXT_OBJ))
-    protected.CMO       = $(file $(name).cmo)
-    protected.AR        = $(file $(name)$(EXT_LIB))
-    protected.CMX       = $(file $(name).cmx)
-    protected.CMI       = $(file $(name).cmi)
-    protected.MLI       = $(file $(name).mli)
-    protected.CMA       = $(file $(name).cma)
-    protected.CMXA      = $(file $(name).cmxa)
-
-    protected.BYTE_TARGETS   = $(CMO) $(CMA)
-    protected.NATIVE_TARGETS = $(CMX) $(OBJ) $(CMXA) $(AR)
-
-    protected.TARGETS = $(CMI)
-
-    if $(NATIVE_ENABLED)
-        TARGETS += $(NATIVE_TARGETS)
-        export
-
-    if $(BYTE_ENABLED)
-        TARGETS += $(BYTE_TARGETS)
-        export
-
-    if $(has_cmodule)
-        TARGETS += dll$(name).so lib$(name)$(EXT_LIB)
-        export
-
-    return $(TARGETS)
-
-# Add a rule for OCaml package $(name).cmo, $(name).cmx and etc.
-#    name
-#        target package name
-#    files
-#        ML module names (without .ml)
-#    cmodules
-#        C source files (without .c)
-#    linkopts
-#        C library link option (without OCaml -cclib options)
-#    is_install
-#        true If install library for ocamlfind. false is that
-#        any files don't install for ocamlfind, then use
-#        OCamlInstallPackage function.
-#
-# Example:
-#     MyOCamlPackage(foo, alpha beta, $(EMPTY), $(EMPTY))
-public.MyOCamlPackage(name, files, cmodules, linkopts, is_install) =
-
-   CSTUBS=$(addsuffix $(EXT_OBJ), $(cmodules))
-   protected.OFILES   = $(addsuffix $(EXT_OBJ), $(files))
-   protected.CMOFILES = $(addsuffix .cmo, $(files))
-   protected.CMXFILES = $(addsuffix .cmx, $(files))
-
-   protected.CMO       = $(file $(name).cmo)
-   protected.CMX       = $(file $(name).cmx)
-   protected.CMA       = $(file $(name).cma)
-   protected.CMXA      = $(file $(name).cmxa)
-   protected.AR        = $(file $(name)$(EXT_LIB))
-
-   CSTUBLIBRARIES=
-   if $(not $(equal $(cmodules), $(EMPTY)))
-       CSTUBLIBRARIES= dll$(name).so lib$(name)$(EXT_LIB)
-       export
-
-   # add a rule for install this package.
-   .PHONY: install-lib
-   install-lib: $(CMO) $(CMX) $(CMA) $(CMXA) $(AR)
-
-   $(CMA) $(CMXA) $(AR) $(CSTUBLIBRARIES): $(CSTUBS) $(CMO) $(CMX)
-       if $(not $(equal $(cmodules), $(EMPTY)))
-           $(OCAMLMKLIB) -o $(name)  $(CMO) $(CMX) $(CSTUBS) $(linkopts)
-       else
-           $(OCamlC) -a -o $(CMA) $(CMO)
-           $(OCamlOpt) -a -o $(CMXA) $(CMX)
-
-   # the followings are nessesary for packing
-   OCAML_PACKAGE_FLAG = -for-pack $(capitalize $(name))
-   export OCAML_PACKAGE_FLAG
-
-   # build rule for package
-   protected.TARGETS = $(OCamlPackage $(name), $(files))
-
-   # add a rule for clean
-   AutoClean()
-
-   if $(is_install)
-       # add install rules
-       targets[] = META $(glob i, *mli) $(name).cmi $(name).cmo $(name).cmx $(name).cma $(name).cmxa $(name).o $(name).a $(CSTUBLIBRARIES)
-
-       if $(defined INSTALLED)
-           $(Installed $(name)): $(targets)
-               $(OCAMLFIND) remove $(name)
-               section:
-                   $(OCAMLFIND) install $(name) $(targets)
-                   CreateInstalled($(name), $(targets))
-           install: $(Installed $(name))
-           uninstall:
-               rm -f $(Installed $(name))
-               $(OCAMLFIND) remove $(name)
-           export
-       else
-           install:
-               $(OCAMLFIND) remove $(name)
-               $(OCAMLFIND) install $(name) $(targets)
-           uninstall:
-               $(OCAMLFIND) remove $(name)
-
-   export
-
-# Add some rules for buidling OCaml package.
-#   name
-#       target package name
-#   files
-#       ML modules name (without .ml)
-public.OCamlPackage(name, files) =
-   # XXX: JYH: these variables should be marked private in 0.9.9
-
-   protected.OFILES   = $(addsuffix $(EXT_OBJ), $(files))
-   protected.CMOFILES = $(addsuffix .cmo, $(files))
-   protected.CMXFILES = $(addsuffix .cmx, $(files))
-
-   protected.OBJ       = $(file $(name)$(EXT_OBJ))
-   protected.CMO       = $(file $(name).cmo)
-   protected.CMX       = $(file $(name).cmx)
-   protected.CMI       = $(file $(name).cmi)
-   protected.MLI       = $(file $(name).mli)
-
-   protected.BYTE_TARGETS   = $(CMO)
-   protected.NATIVE_TARGETS = $(CMX) $(OBJ)
-
-   protected.TARGETS = $(CMI)
-
-   if $(NATIVE_ENABLED)
-       TARGETS += $(NATIVE_TARGETS)
-       export
-
-   if $(BYTE_ENABLED)
-       TARGETS += $(BYTE_TARGETS)
-       export
-
-   #
-   # Link commands
-   #
-   protected.BYTE_DEPS = $(CMOFILES)
-   $(BYTE_TARGETS): $(CMOFILES)
-      section rule
-         if $(or $(NATIVE_ENABLED), $(target-exists $(MLI)))
-             BYTE_DEPS += $(CMI)
-             export
-         else
-             BYTE_TARGETS += $(CMI)
-             export
-         $(BYTE_TARGETS): $(BYTE_DEPS)
-            $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
-                $(OCAMLCFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMO) $(OCamlLinkSort $(CMOFILES))
-
-   protected.NATIVE_DEPS = $(CMXFILES) $(OFILES)
-   $(NATIVE_TARGETS): $(NATIVE_DEPS)
-      section rule
-         if $(target-exists $(MLI))
-            NATIVE_DEPS += $(CMI)
-            export
-         else
-            NATIVE_TARGETS += $(CMI)
-            export
-         $(NATIVE_TARGETS): $(NATIVE_DEPS)
-            $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
-                $(OCAMLOPTFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMX) $(OCamlLinkSort $(CMXFILES))
-
-   $(CMI):
-      section rule
-         if $(target-exists $(MLI))
-            $(CMI): $(MLI) :scanner: scan-ocaml-$(name).mli
-                $(OCamlC) -c $<
-         elseif $(NATIVE_ENABLED)
-            $(NATIVE_TARGETS) $(CMI): $(NATIVE_DEPS)
-               $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
-                   $(OCAMLOPTFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMX) $(OCamlLinkSort $(CMXFILES))
-         else
-            $(BYTE_TARGETS) $(CMI): $(BYTE_DEPS)
-               $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
-                   $(OCAMLCFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMO) $(OCamlLinkSort $(CMOFILES))
-
-   return $(TARGETS)
-
-# Generate document by ocamldoc for some targets.
-#   title
-#       title for documents.
-#   path
-#       output directory for generated documents
-#   files
-#       ML modules name (without .ml)
-#   imageext
-#       image extention without "." if generate depend image from .dot.
-public.GenerateOcamldoc(title, path, files, ?imageext) =
-    protected.ML       = $(addsuffix .ml, $(files))
-    protected.MLI       = $(filter-exists $(addsuffix .mli, $(files)))
-    protected.DIR =
-    protected.DOT_FOUND = $(CheckProg dot)
-    protected.INDEX_HTML = $(dir $(path))$(DIRSEP)index.html
-
-    if $(not $(equal $(dir $(path)), $(dir $(CWD))))
-        if $(not $(file-exists $(path)))
-            eprintln(Error: Making sure target directory is exists. $(path) don\'t exists)
-            return
-        DIR = -d $(dir $(path))
-        export
-
-    depend.dot : $(ML) $(MLI)
-        $(OCAMLFIND) $(OCAMLDOC) $(PREFIXED_OCAMLINCLUDES) $(PREFIXED_OCAMLPACKS) \
-            -dot -dot-include-all -dot-reduce $+ -o $@
-
-    if $(and $(not $(equal $(imageext), $(EMPTY))), $(DOT_FOUND))
-        depend.$(imageext): depend.dot
-            dot -T$(imageext) $< -o $@
-        export
-
-    $(INDEX_HTML): $(ML) $(MLI)
-        $(OCAMLFIND) $(OCAMLDOC) -html $(PREFIXED_OCAMLINCLUDES) $(PREFIXED_OCAMLPACKS) \
-             -t $(title) $(DIR) -m A -stars -all-params -colorize-code $+
-
-    # add a clean rule
-    AutoClean()
-
-    clean:
-        rm -f $(dir $(path))$(DIRSEP)*html
-        rm -f $(dir $(path))$(DIRSEP)*css
-        rm -f depend.dot
-        rm -f depend.*
-
-    return $(INDEX_HTML) depend.dot
-
-# Generate install rule for library_name of ocamlfind library
-# that add or install given files.
-#
-# note:: files returned from this function include META file.
-#
-#     library_name
-#        name of library. already installed library or new library.
-#     files
-#        install or add files. You can use often $(OCamlPackageGeneratedFiles) or others.
-public.OCamlInstallPackage(name, files) =
-	targets[] = META $(files)
-
-	if $(defined INSTALLED)
-		$(Installed $(name)): $(targets)
-			$(OCAMLFIND) remove $(name)
-			section:
-				$(OCAMLFIND) install $(name) $(targets)
-				CreateInstalled($(name), $(targets))
-		install: $(Installed $(name))
-		uninstall:
-			rm -f $(Installed $(name))
-			$(OCAMLFIND) remove $(name)
-		export
-	else
-		install:
-			$(OCAMLFIND) remove $(name)
-			$(OCAMLFIND) install $(name) $(targets)
-		uninstall:
-			$(OCAMLFIND) remove $(name)
-
-# Generate install rule for parent library of ocamlfind library
-# that add given files to it.
-#
-# note:: files returned from this function don't include META file because
-#        rule added by this function is only add to exists package.
-#
-#     library_name
-#        name of parent library. already installed library only.
-#     files
-#        add files. You can use often $(OCamlPackageGeneratedFiles) or others.
-public.OCamlInstallParentPackage(name, files) =
-	targets[] = $(files)
-
-	if $(defined INSTALLED)
-		$(Installed $(name)): $(targets)
-			section:
-				$(OCAMLFIND) install -add $(name) $(targets)
-				CreateInstalled($(name), $(targets))
-		install: $(Installed $(name))
-		uninstall:
-			rm -f $(Installed $(name))
-			$(OCAMLFIND) remove $(name)
-		export
-	else
-		install:
-			$(OCAMLFIND) install -add $(name) $(targets)
-		uninstall:
-			$(OCAMLFIND) remove $(name)
+open build/Common
+open configure/Configure
+open MyFunction
+
+public.USE_OCAMLFIND = false
+
+.STATIC:
+    OCAMLFIND_EXISTS = $(CheckProg ocamlfind)
+    OCAMLC_OPT_EXISTS = $(CheckProg ocamlc.opt)
+    OCAMLC_EXISTS = $(or $(OCAMLC_OPT_EXISTS), $(CheckProg ocamlc))
+    OCAMLOPT_OPT_EXISTS = $(CheckProg ocamlopt.opt)
+    OCAMLOPT_EXISTS = $(or $(OCAMLOPT_OPT_EXISTS), $(CheckProg ocamlopt))
+    ConfMsgChecking(whether ocamlc understands the "z" warnings)
+    OCAML_ACCEPTS_Z_WARNING =
+        if $(OCAMLC_EXISTS)
+            value $(ConfMsgYesNo $(shell-success-null ocamlc$(if $(OCAMLC_OPT_EXISTS), .opt) -w Az))
+        else
+            ConfMsgResult($"FAILED - ocamlc not found")
+            value false
+    OCAMLC = $(if $(OCAMLC_OPT_EXISTS), $`(if $(USE_OCAMLFIND), ocamlc, ocamlc.opt), ocamlc)
+    OCAMLOPT = $(if $(OCAMLOPT_OPT_EXISTS), $`(if $(USE_OCAMLFIND), ocamlopt, ocamlopt.opt), ocamlopt)
+    CAMLIDL_EXISTS = $(CheckProg camlidl)
+    #
+    # Compile native or byte code?
+    #
+    NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+    BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
+
+    # Debug build enable if defined DEBUG variable when --configure or first time of omake execution.
+    DEBUG_ENABLE = false
+    if $(and $(defined DEBUG), $(equal $(DEBUG), 1))
+        DEBUG_ENABLE = true
+        export
+
+public.CAMLIDL = $`(if $(CAMLIDL_EXISTS), camlidl)
+public.OCAMLFIND = $`(if $(USE_OCAMLFIND), ocamlfind)
+public.OCAMLFINDFLAGS =
+public.LAZY_OCAMLFINDFLAGS = $`(if $(USE_OCAMLFIND), $(OCAMLFINDFLAGS))
+
+public.OCAMLDEP = ocamldep
+public.CAMLP4 = camlp4
+public.OCAMLLEX = ocamllex
+public.OCAMLLEXFLAGS = -q
+public.OCAMLYACC = ocamlyacc
+public.OCAMLYACCFLAGS =
+public.OCAMLMKTOP = ocamlmktop
+public.OCAMLMKLIB = ocamlmklib
+public.OCAMLLINK = $`(OCAMLC)
+public.OCAMLOPTLINK = $`(OCAMLOPT)
+public.OCAMLDOC = ocamldoc
+
+#
+# Include path
+#
+public.OCAMLINCLUDES[] = .
+public.PREFIXED_OCAMLINCLUDES = $`(mapprefix -I, $(OCAMLINCLUDES))
+
+#
+# Packages
+#
+public.OCAMLPACKS[] =
+public.PREFIXED_OCAMLPACKS =\
+   $`(if $(and $(USE_OCAMLFIND) $(gt $(length $(OCAMLPACKS)), 0)),\
+         -package $(string $(concat \,, $(OCAMLPACKS))),\
+         $(EMPTY))
+
+#
+# Various options
+#
+declare OCAMLDEPFLAGS
+public.OCAMLPPFLAGS  =
+public.OCAMLFLAGS    = -warn-error A
+public.OCAMLCFLAGS   = $`(if $(DEBUG_ENABLE), -g)
+public.OCAMLOPTFLAGS =
+public.OCAMLCPPFLAGS =
+public.OCAML_LINK_FLAGS = $`(if $(and $(USE_OCAMLFIND) $(gt $(length $(OCAMLPACKS)), 0)), -linkpkg, $(EMPTY))
+public.OCAML_BYTE_LINK_FLAGS = -custom
+public.OCAML_NATIVE_LINK_FLAGS =
+# ocaml packaging option
+OCAML_PACKAGE_FLAG =
+
+public.LocalOCamlGeneratedFiles(files) =
+    if $(OCAMLDEP_MODULES_ENABLED)
+        # For now, we want to allow ``backwards-compatible'' projects.
+        # eprintln($"WARNING: OCamlGeneratedFiles should not be used when OCAMLDEP_MODULES_ENABLED")
+        # eprintln($"         is set")
+    else
+        .SCANNER: scan-ocaml-%: $(files)
+        .SCANNER: %.cmi: $(files)
+        .SCANNER: %.cmx %.cmo: $(files)
+        export
+    export
+
+#
+# OCAML_LIBS contains libraries that are used as dependencies
+# OCAML_OTHER_LIBS contains other libraries (like unix.cma)
+# The lists do not include suffixes.
+#
+# OCAML_LINK_FLAGS contains extra linking information
+#
+public.OCAML_LIBS =
+public.OCAML_CLIBS =
+public.OCAML_OTHER_LIBS =
+public.OCAML_LIB_FLAGS =
+
+########################################################################
+# As of OCaml version 3.09.2, the standard \verb+ocamldep+ scanner is ``broken''.  The main issue is
+# that it finds only those dependencies that already exist.  If \verb+foo.ml+ contains a dependency
+# on \verb+Bar+,
+#
+.STATIC:
+    OCAMLDEP_MODULES =
+    OCAMLDEP_MODULES_USE_OCAMLFIND = true
+    ConfMsgChecking(if ocamldep understands -modules)
+    OCAMLDEP_MODULES_AVAILABLE = $(ConfMsgYesNo $(shell-success-null ocamldep -modules))
+    if $(OCAMLDEP_MODULES_AVAILABLE)
+        OCAMLDEP_MODULES = ocamldep
+        export
+    else
+        ConfMsgChecking(for ocamldep-omake bytecode file)
+        OCAMLDEP_OMAKE = $(find-in-path-optional $(PATH), ocamldep-omake)
+        if $(OCAMLDEP_OMAKE)
+            OCAMLDEP_OMAKE = $(file $(OCAMLDEP_OMAKE))
+            ConfMsgResult(found $(absname $(OCAMLDEP_OMAKE)))
+
+            ConfMsgChecking(if ocamldep-omake runs)
+            OCAMLDEP_MODULES_AVAILABLE = $(ConfMsgYesNo $(shell-success-null ocamlrun $(OCAMLDEP_OMAKE) -modules))
+            OCAMLDEP_MODULES = $(if $(OCAMLDEP_MODULES_AVAILABLE), ocamlrun $(OCAMLDEP_OMAKE))
+            OCAMLDEP_MODULES_USE_OCAMLFIND = false
+            export
+        else
+            ConfMsgResult(NOT FOUND)
+        export OCAMLDEP_MODULES_AVAILABLE OCAMLDEP_MODULES OCAMLDEP_MODULES_USE_OCAMLFIND
+
+    OCAMLDEP_MODULES_ENABLED = $(OCAMLDEP_MODULES_AVAILABLE)
+
+public.OCAMLDEPFLAGS = $`(if $(and $(NATIVE_ENABLED), $(not $(OCAMLDEP_MODULES_ENABLED))), -native, $(EMPTY))
+
+# Print the dependencies for a ML file, based on the
+# .cmi files.
+#
+# If OCAMLDEP_PRESERVE_TARGETS is true, then the
+# ocamldep entries are taken literally (the suffix
+# is not replaced with .cmo/.cmx).
+#
+public.OCAMLDEP_PRESERVE_TARGETS = false
+
+public.PrintMLIDependencies(filename, cmideps) =
+    if $(cmideps)
+        private.base = $(string-escaped $(removesuffix $(filename)))
+        println($"""$(base).cmi: $(string-escaped $(cmideps))""")
+
+public.PrintMLDependencies(filename, cmideps, cmxdeps) =
+    private.base = $(string-escaped $(removesuffix $(filename)))
+    private.esc = $' \'
+    private.text =
+    if $(cmideps)
+        cmideps = $(string-escaped $(cmideps))
+        private.text = $"""
+$(base).cmo: $(cmideps)
+$(base).cmx $(base)$(EXT_OBJ):$(esc)
+    $(cmideps)"""
+        export text
+    if $(cmxdeps)
+        private.odeps = $(string-escaped $(addsuffix $(EXT_OBJ), $(removesuffix $(cmxdeps))))
+        if $(not $(text))
+            text = $"""$(base).cmx $(base)$(EXT_OBJ):"""
+            export
+        text += $"""$(esc)
+    $(string-escaped $(cmxdeps))$(esc)
+    $(odeps)"""
+        export text
+    # eprintln($(text))
+    println($(text))
+
+public.PrintFileDependencies(filename, cmideps) =
+    if $(cmideps)
+        private.text = $"""$(string-escaped $(filename)): $(string-escaped $(cmideps))"""
+        # eprintln($(text))
+        println($(text))
+
+#
+# Given a set of literal dependencies, compute
+# the actual dependencies by finding the filenames
+# associated with each module.
+#
+public.PrintDependencies(filename, modules) =
+    if $(filename)
+        #
+        # Find the .cmi files that can be built
+        #
+        private.cmideps = $(find-ocaml-targets-in-path-optional $(OCAMLINCLUDES), $(addsuffix .cmi, $(modules)))
+
+        # Now produce the dependencies
+        if $(OCAMLDEP_PRESERVE_TARGETS)
+            PrintFileDependencies($(filename), $(cmideps))
+        else
+            switch($(suffix $(filename)))
+            case .ml
+                protected.cmxdeps[] =
+                if $(NATIVE_ENABLED)
+                    cmxdeps = $(find-ocaml-targets-in-path-optional $(OCAMLINCLUDES), $(addsuffix .cmx, $(modules)))
+                    export
+                PrintMLDependencies($(filename), $(cmideps), $(cmxdeps))
+            case .mli
+                PrintMLIDependencies($(filename), $(cmideps))
+            default
+                eprintln($"ocaml scanner: illegal filename $(filename)")
+                exit(1)
+
+#
+# Post-process the output of ocamldep.
+# Use awk to process the input, find the targets that
+# exist, and then print the dependencies.
+#
+public.OCamlScannerPostproc() =
+    #
+    # Read the module names from the standard input
+    #
+    protected.filename =
+    protected.modules[] =
+    awk(b, $(stdin))
+    case $'^\(.*\):[[:space:]]*\(.*\)$'
+        PrintDependencies($(filename), $(modules))
+        filename = $1
+        modules[] = $(split $' ', $2)
+        export
+    case $'^	\(.*\)'
+        # Add the dependency
+        modules[] += $1
+        export
+    default
+        eprintln(Unrecognized ocamldep output: $0)
+    PrintDependencies($(filename), $(modules))
+
+Shell. +=
+    ocamldep-postproc(argv) =
+        if $(mem -preserve-targets, $(argv))
+           OCAMLDEP_PRESERVE_TARGETS = true
+           export
+        OCamlScannerPostproc()
+
+public.OCamlScanner(src_file) =
+    if $(OCAMLDEP_MODULES_ENABLED)
+        if $(OCAMLDEP_MODULES_USE_OCAMLFIND)
+            value $(OCAMLFIND) $(OCAMLDEP_MODULES) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLDEPFLAGS) -modules $(src_file) | ocamldep-postproc
+        else
+            value $(OCAMLDEP_MODULES) $(OCAMLDEPFLAGS) -modules $(src_file) | ocamldep-postproc
+    else
+        value $(OCAMLFIND) $(OCAMLDEP) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLDEPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(src_file)
+
+#
+# Generic scanners
+#
+OCamlScannerTargets(files) =
+    files[] = $(basename $(files))
+    files[] = $(if $(NATIVE_ENABLED), $(files), $(filter-out %.cmx, $(files)))
+    files[] = $(if $(BYTE_ENABLED), $(files), $(filter-out %.cmo, $(files)))
+    value $(find-targets-in-path-optional $(OCAMLINCLUDES), $(files)) $(NATIVE_ENABLED) $(BYTE_ENABLED)
+
+.SCANNER: scan-ocaml-%.mli: %.mli /.PHONY/OCamlGeneratedFilesTarget :value: $(OCamlScannerTargets $&)
+    $(OCamlScanner $<)
+
+.SCANNER: scan-ocaml-%.ml: %.ml /.PHONY/OCamlGeneratedFilesTarget :exists: %.mli :value: $(OCamlScannerTargets $&)
+    $(OCamlScanner $<)
+
+#
+# Default .SCANNER rules for backwards-compatibility.
+#
+.SCANNER: %.cmi: %.mli /.PHONY/OCamlGeneratedFilesTarget :value: $(OCamlScannerTargets $&)
+    $(OCamlScanner $<)
+
+.SCANNER: %.cmx %.cmo %$(EXT_OBJ): %.ml /.PHONY/OCamlGeneratedFilesTarget :exists: %.mli :value: $(OCamlScannerTargets $&)
+    $(OCamlScanner $<)
+
+#
+# Define a link order for OCaml files.
+# If a file depends on a %.cmi, it also depends on %.cmo
+#
+.ORDER: .OCAMLLINK
+
+.OCAMLLINK: %.cmi: %.cmo
+.OCAMLLINK: %.cmx: %.cmo
+
+public.ABORT_ON_DEPENDENCY_ERRORS = false
+
+OCamlLinkSort(nodes) =
+   if $(ABORT_ON_DEPENDENCY_ERRORS)
+      value $(file-check-sort .OCAMLLINK, $(nodes))
+   else
+      value $(file-sort .OCAMLLINK, $(nodes))
+
+
+# generic OCaml compile function.
+public.OCamlC() =
+    value $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
+              $(OCAMLCFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(OCAML_PACKAGE_FLAG)
+
+public.OCamlOpt() =
+    value $(OCAMLFIND) $(OCAMLOPT) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
+              $(OCAMLOPTFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES) $(OCAML_PACKAGE_FLAG)
+
+%.ml : %.mll
+    $(OCAMLLEX) $(OCAMLLEXFLAGS) $<
+
+
+########################################################################
+# Parser generators
+#
+
+#
+# You can choose to use ocamlyacc or menhir for a parser
+# generator.  The default is ocamlyacc.  Define the
+# MENHIR_ENABLED as true if you would rather use menhir.
+#
+# Variables:
+#    MENHIR : the name of the menhir executable
+#    MENHIR_FLAGS : any additional options to pass to Menhir
+#    MENHIR_AVAILABLE : the menhir executable is installed
+#    MENHIR_RAW_DEPEND : menhir supports the --raw-depend option
+#
+public.MENHIR = menhir
+public.MENHIR_FLAGS =
+public.MENHIR_ENABLED = false
+.STATIC:
+    MENHIR_AVAILABLE = $(CheckProg $(MENHIR))
+    MENHIR_RAW_DEPEND = false
+    if $(MENHIR_AVAILABLE)
+        ConfMsgChecking(if $(MENHIR) supports the --raw-depend option)
+        MENHIR_RAW_DEPEND = $(ConfMsgYesNo $(shell-success-null $(MENHIR) -help | grep $'^ *--raw-depend'))
+        export
+
+# Menhir is being requested.  Check that it is installed.
+public.MenhirCheck() =
+    if $(not $(MENHIR_AVAILABLE))
+       eprintln($"""!!! You are asking to use Menhir, but it is not installed.""")
+       eprintln($"""!!! See the Menhir home page for instructions on downloading.""")
+       eprintln($"""!!!    http://cristal.inria.fr/~fpottier/menhir/""")
+       exit(1)
+
+# Compute the correct ocamlc and ocamldep options for Menhir.
+public.MenhirOCamlcCommand() =
+    MenhirCheck()
+    private.ocamlc[] =\
+       $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS)\
+           $(OCAMLCFLAGS) $(OCAMLPPFLAGS) $(PREFIXED_OCAMLINCLUDES)
+    value --ocamlc $(quote-argv $(ocamlc))
+
+public.MenhirOCamldepCommand(raw) =
+    ocamldep =
+       if $(raw)
+           value $(OCAMLDEP) -modules $(OCAMLDEPFLAGS)
+       else
+           value $(OCAMLDEP) $(PREFIXED_OCAMLINCLUDES) $(OCAMLDEPFLAGS)
+    value --ocamldep $(quote-argv $(ocamldep))
+
+# Compute the Mendir dependency scanner command
+public.MenhirScannerCommand(base, src) =
+    if $(MENHIR_ENABLED)
+        if $(and $(MENHIR_RAW_DEPEND), $(OCAMLDEP_MODULES_ENABLED))
+            value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamldepCommand true) $(base) --raw-depend $(src) | ocamldep-postproc -preserve-targets
+        else
+            value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamldepCommand false) $(base) --depend $(src)
+
+# Use Menhir if MENHIR_ENABLED, ocamlyacc otherwise
+public.OCamlYaccCommand(src) =
+    if $(MENHIR_ENABLED)
+        value $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamlcCommand) $(src)
+    else
+        value $(OCAMLYACC) $(OCAMLYACCFLAGS) $(src)
+
+.SCANNER: scan-ocamlyacc-%.mly: %.mly :value: $(MENHIR_ENABLED) $(OCamlScannerTargets $&)
+    $(MenhirScannerCommand $(EMPTY), $<)
+
+%.ml %.mli: %.mly :scanner: scan-ocamlyacc-%.mly
+    $(OCamlYaccCommand $<)
+
+#
+# \begin{doc}
+# \subsection{Using the Menhir parser generator}
+#
+# Menhir is a parser generator that is mostly compatible with
+# \verb+ocamlyacc+, but with many improvements.  A few of these
+# are listed here (excerpted from the Menhir home page
+# \url{http://cristal.inria.fr/~fpottier/menhir/}).
+#
+# \begin{itemize}
+# \item Menhir's explanations are believed to be understandable by mere humans.
+# \item Menhir allows grammar specifications to be split over multiple files.
+#     It also allows several grammars to share a single set of tokens.
+# \item Menhir is able to produce parsers that are parameterized by Objective Caml modules.
+# \item [Added by jyh] With the \verb+--infer+ option, Menhir can typecheck the semantic actions
+#    in your grammar at \emph{generation} time.
+# \end{itemize}
+#
+# What do you need to do to use Menhir instead of \verb+ocamlyacc+?
+# \begin{enumerate}
+# \item Place the following definition before the relevant section of your project
+#    (or at the top of your project \verb+OMakefile+ if you want to use Menhir everywhere).
+#
+# \begin{verbatim}
+#    MENHIR_ENABLED = true
+# \end{verbatim}
+#
+# \item Optionally, add any desired Menhir options to the \verb+MENHIR_FLAGS+ variable.
+#
+# \begin{verbatim}
+#    MENHIR_FLAGS += --infer
+# \end{verbatim}
+# \end{enumerate}
+#
+# With this setup, any file with a \verb+.mly+ suffix will be compiled with Menhir.
+#
+# If your grammar is split across several files, you need to specify it explicitly,
+# using the \verb+MenhirMulti+ function.
+#
+# \begin{verbatim}
+#     MenhirMulti(target, sources)
+#         target : filename, without suffix
+#         sources : the files that define the grammar, without suffixes
+# \end{verbatim}
+#
+# For example, if you want to generate the parser files \verb+parse.ml+ and \verb+parse.mli+,
+# from the grammar specified in files \verb+a.mly+ and \verb+b.mly+, you would use
+# the following.
+#
+# \begin{verbatim}
+#     MenhirMulti(parse, a b)
+# \end{verbatim}
+# \end{doc}
+#
+public.MenhirMulti(target, sources) =
+    MenhirCheck()
+    sources = $(addsuffix .mly, $(sources))
+
+    # Menhir needs all the files for dependency analysis
+    .SCANNER: scan-menhir-$(target).multi: $(sources) :value: $(OCamlScannerTargets $&)
+        $(MenhirScannerCommand --base $(target), $+)
+
+    # Set up the actual rule
+    $(target).ml $(target).mli: $(sources) :scanner: scan-menhir-$(target).multi
+        $(MENHIR) $(MENHIR_FLAGS) $(MenhirOCamlcCommand) --base $(target) $+
+
+%.cmx : %.ml
+    section rule
+        if $(not $(NATIVE_ENABLED))
+            err. =
+                extends $(UnbuildableException)
+                message = $(string $"You are trying to build OCaml native code file: "%.cmx$"
+However, the NATIVE_ENABLED flag is not set.
+Include the following definition in your OMakefile
+if you really want to build this file.
+       NATIVE_ENABLED = true")
+                target = $(file %.cmx)
+            raise $(err)
+        elseif $(target-exists %.mli)
+            %.cmx %$(EXT_OBJ): %.ml %.cmi :scanner: scan-ocaml-%.ml
+                $(OCamlOpt) -c $<
+        elseif $(BYTE_ENABLED)
+            %.cmx %.cmi %$(EXT_OBJ) %.cmo: %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlC) -c $<
+                $(OCamlOpt) -c $<
+        else
+            %.cmx %.cmi %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlOpt) -c $<
+
+%$(EXT_OBJ): %.ml
+    section rule
+        if $(not $(NATIVE_ENABLED))
+            err. =
+                extends $(UnbuildableException)
+                message = $(string $"You are trying to build OCaml native code file: "%$(EXT_OBJ)$"
+However, the NATIVE_ENABLED flag is not set.
+Include the following definition in your OMakefile
+if you really want to build this file.
+       NATIVE_ENABLED = true")
+                target = $(file %.cmx)
+            raise $(err)
+        elseif $(target-exists %.mli)
+            %$(EXT_OBJ) %.cmx: %.ml %.cmi :scanner: scan-ocaml-%.ml
+                $(OCamlOpt) -c $<
+        elseif $(BYTE_ENABLED)
+            %$(EXT_OBJ) %.cmi %.cmx %.cmo: %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlC) -c $<
+                $(OCamlOpt) -c $<
+        else
+            %$(EXT_OBJ) %.cmi %.cmx: %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlOpt) -c $<
+
+%.cmo: %.ml
+    section rule
+        if $(not $(BYTE_ENABLED))
+            err. =
+                extends $(UnbuildableException)
+                message = $(string $"You are trying to build OCaml native code file: "%.cmo$"
+However, the BYTE_ENABLED flag is not set.
+Include the following definition in your OMakefile
+if you really want to build this file.
+       BYTE_ENABLED = true")
+                target = $(file %.cmx)
+            raise $(err)
+        elseif $(target-exists %.mli)
+            %.cmo: %.ml %.cmi :scanner: scan-ocaml-%.ml
+                $(OCamlC) -c $<
+        elseif $(NATIVE_ENABLED)
+            %.cmo %.cmi %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlC) -c $<
+                $(OCamlOpt) -c $<
+        else
+            %.cmo %.cmi: %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlC) -c $<
+
+%.cmi: %.ml
+    section rule
+        if $(BYTE_ENABLED)
+            if $(NATIVE_ENABLED)
+                %.cmi %.cmo %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
+                    $(OCamlC) -c $<
+                    $(OCamlOpt) -c $<
+            else
+                %.cmi %.cmo: %.ml :scanner: scan-ocaml-%.ml
+                    $(OCamlC) -c $<
+        else
+            %.cmi %.cmx %$(EXT_OBJ): %.ml :scanner: scan-ocaml-%.ml
+                $(OCamlOpt) -c $<
+
+%.cmi: %.mli
+    $(OCamlC) -c $<
+
+%.cmti: %.mli
+    $(OCamlC) -c $<
+
+%.cmt: %.ml
+    $(OCamlC) $<
+
+%.annot: %.ml
+    $(OCamlC) $<
+
+# build rules
+# ======================================================================
+
+public.OCamlProgram(name, files) =
+   # XXX: JYH: these variables should be marked private in 0.9.9
+   protected.CMOFILES  = $(addsuffix .cmo, $(files))
+   protected.CMXFILES  = $(addsuffix .cmx, $(files))
+   protected.OFILES    = $(addsuffix $(EXT_OBJ), $(files))
+
+   protected.CMAFILES  = $(addsuffix .cma,  $(OCAML_LIBS))
+   protected.CMXAFILES = $(addsuffix .cmxa, $(OCAML_LIBS))
+   protected.ARFILES   = $(addsuffix $(EXT_LIB), $(OCAML_LIBS))
+   protected.CMA_OTHER_FILES = $(addsuffix .cma, $(OCAML_OTHER_LIBS))
+   protected.CMXA_OTHER_FILES = $(addsuffix .cmxa, $(OCAML_OTHER_LIBS))
+
+   protected.CLIBS = $(addsuffix $(EXT_LIB), $(OCAML_CLIBS))
+
+   protected.name = $(file $(name))
+
+   protected.PROG     = $(file $(name)$(EXE))
+   protected.BYTEPROG = $(file $(name).run)
+   protected.OPTPROG  = $(file $(name).opt)
+
+   #
+   # Rules to build byte-code and native targets
+   #
+   $(BYTEPROG): $(CMAFILES) $(CMOFILES) $(CLIBS)
+        $(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLCFLAGS)\
+                $(PREFIXED_OCAMLINCLUDES) $(OCAML_BYTE_LINK_FLAGS)\
+                -o $@ $(CMA_OTHER_FILES) $(CMAFILES) $(OCamlLinkSort $(CMOFILES))\
+                $(CLIBS) $(OCAML_LINK_FLAGS)
+
+   $(OPTPROG): $(CMXAFILES) $(ARFILES) $(CMXFILES) $(OFILES) $(CLIBS)
+        $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS)\
+                $(PREFIXED_OCAMLINCLUDES) $(OCAML_NATIVE_LINK_FLAGS)\
+                -o $@ $(CMXA_OTHER_FILES) $(CMXAFILES) $(OCamlLinkSort $(CMXFILES))\
+                $(CLIBS) $(OCAML_LINK_FLAGS)
+
+   #
+   # Link the actual executables.
+   # Always prefer native executables.
+   #
+   if $(NATIVE_ENABLED)
+        $(PROG): $(OPTPROG)
+            ln-or-cp $< $@
+   else
+        $(PROG): $(BYTEPROG)
+            ln-or-cp $< $@
+
+   return $(array $(PROG), $(if $(NATIVE_ENABLED), $(OPTPROG)), $(if $(BYTE_ENABLED), $(BYTEPROG)))
+
+# Add rules to build OCaml library $(name)
+#    name
+#        name of the library
+#    files
+#        OCaml module names (without .ml)
+#
+#   .. note :: Probably you should use MyOCamlPackage
+MyOCamlLibrary(library, files) =
+   install-lib: $(OCamlLibrary $(library), $(files))
+   AutoClean()
+
+# build library with targets. this function returns between one and three file names.
+OCamlLibrary(library, targets) =
+    protected.name = $(file $(library))
+
+    protected.OFILES = $(addsuffix $(EXT_OBJ), $(targets))
+    protected.CMOFILES = $(addsuffix .cmo, $(targets))
+    protected.CMXFILES = $(addsuffix .cmx, $(targets))
+
+    protected.CLIB = $(file $(name)$(EXT_LIB))
+    protected.BYTELIB = $(file $(name).cma)
+    protected.NATIVELIB = $(file $(name).cmxa)
+
+    # Link commands
+    $(BYTELIB): $(CMOFILES)
+        $(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLCFLAGS) \
+                $(OCAML_LIB_FLAGS) -a -o $@ $(OCamlLinkSort $(CMOFILES))
+    $(NATIVELIB) $(CLIB): $(CMXFILES) $(OFILES)
+        $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) \
+                $(OCAML_LIB_FLAGS) -a -o $(NATIVELIB) $(OCamlLinkSort $(CMXFILES))
+    return $(array $(if $(NATIVE_ENABLED), $(NATIVELIB)), $(if $(NATIVE_ENABLED), $(CLIB)), $(if $(BYTE_ENABLED), $(BYTELIB)))
+
+# Get files which are made by MyOCamlPackage function.
+# files returned this function are targeted in MyOCamlPackage, then
+# it can be used as dependency for any target.
+#
+#    name
+#        target package name
+#    has_cmodule
+#        flag to have C modules for this package whether true or false.
+# Example:
+#    OCamlPackageTargetFiles(hoge, true)
+#
+public.OCamlPackageGeneratedFiles(name, has_cmodule) =
+    protected.OBJ       = $(file $(name)$(EXT_OBJ))
+    protected.CMO       = $(file $(name).cmo)
+    protected.AR        = $(file $(name)$(EXT_LIB))
+    protected.CMX       = $(file $(name).cmx)
+    protected.CMI       = $(file $(name).cmi)
+    protected.MLI       = $(file $(name).mli)
+    protected.CMA       = $(file $(name).cma)
+    protected.CMXA      = $(file $(name).cmxa)
+
+    protected.BYTE_TARGETS   = $(CMO) $(CMA)
+    protected.NATIVE_TARGETS = $(CMX) $(OBJ) $(CMXA) $(AR)
+
+    protected.TARGETS = $(CMI)
+
+    if $(NATIVE_ENABLED)
+        TARGETS += $(NATIVE_TARGETS)
+        export
+
+    if $(BYTE_ENABLED)
+        TARGETS += $(BYTE_TARGETS)
+        export
+
+    if $(has_cmodule)
+        TARGETS += dll$(name).so lib$(name)$(EXT_LIB)
+        export
+
+    return $(TARGETS)
+
+# Add a rule for OCaml package $(name).cmo, $(name).cmx and etc.
+#    name
+#        target package name
+#    files
+#        ML module names (without .ml)
+#    cmodules
+#        C source files (without .c)
+#    linkopts
+#        C library link option (without OCaml -cclib options)
+#    is_install
+#        true If install library for ocamlfind. false is that
+#        any files don't install for ocamlfind, then use
+#        OCamlInstallPackage function.
+#
+# Example:
+#     MyOCamlPackage(foo, alpha beta, $(EMPTY), $(EMPTY))
+public.MyOCamlPackage(name, files, cmodules, linkopts, is_install) =
+
+   CSTUBS=$(addsuffix $(EXT_OBJ), $(cmodules))
+   protected.OFILES   = $(addsuffix $(EXT_OBJ), $(files))
+   protected.CMOFILES = $(addsuffix .cmo, $(files))
+   protected.CMXFILES = $(addsuffix .cmx, $(files))
+
+   protected.CMO       = $(file $(name).cmo)
+   protected.CMX       = $(file $(name).cmx)
+   protected.CMA       = $(file $(name).cma)
+   protected.CMXA      = $(file $(name).cmxa)
+   protected.AR        = $(file $(name)$(EXT_LIB))
+
+   CSTUBLIBRARIES=
+   if $(not $(equal $(cmodules), $(EMPTY)))
+       CSTUBLIBRARIES= dll$(name).so lib$(name)$(EXT_LIB)
+       export
+
+   # add a rule for install this package.
+   .PHONY: install-lib
+   install-lib: $(CMO) $(CMX) $(CMA) $(CMXA) $(AR)
+
+   $(CMA) $(CMXA) $(AR) $(CSTUBLIBRARIES): $(CSTUBS) $(CMO) $(CMX)
+       if $(not $(equal $(cmodules), $(EMPTY)))
+           $(OCAMLMKLIB) -o $(name)  $(CMO) $(CMX) $(CSTUBS) $(linkopts)
+       else
+           $(OCamlC) -a -o $(CMA) $(CMO)
+           $(OCamlOpt) -a -o $(CMXA) $(CMX)
+
+   # the followings are nessesary for packing
+   OCAML_PACKAGE_FLAG = -for-pack $(capitalize $(name))
+   export OCAML_PACKAGE_FLAG
+
+   # build rule for package
+   protected.TARGETS = $(OCamlPackage $(name), $(files))
+
+   # add a rule for clean
+   AutoClean()
+
+   if $(is_install)
+       # add install rules
+       targets[] = META $(glob i, *mli) $(name).cmi $(name).cmo $(name).cmx $(name).cma $(name).cmxa $(name).o $(name).a $(CSTUBLIBRARIES)
+
+       if $(defined INSTALLED)
+           $(Installed $(name)): $(targets)
+               $(OCAMLFIND) remove $(name)
+               section:
+                   $(OCAMLFIND) install $(name) $(targets)
+                   CreateInstalled($(name), $(targets))
+           install: $(Installed $(name))
+           uninstall:
+               rm -f $(Installed $(name))
+               $(OCAMLFIND) remove $(name)
+           export
+       else
+           install:
+               $(OCAMLFIND) remove $(name)
+               $(OCAMLFIND) install $(name) $(targets)
+           uninstall:
+               $(OCAMLFIND) remove $(name)
+
+   export
+
+# Add some rules for buidling OCaml package.
+#   name
+#       target package name
+#   files
+#       ML modules name (without .ml)
+public.OCamlPackage(name, files) =
+   # XXX: JYH: these variables should be marked private in 0.9.9
+
+   protected.OFILES   = $(addsuffix $(EXT_OBJ), $(files))
+   protected.CMOFILES = $(addsuffix .cmo, $(files))
+   protected.CMXFILES = $(addsuffix .cmx, $(files))
+
+   protected.OBJ       = $(file $(name)$(EXT_OBJ))
+   protected.CMO       = $(file $(name).cmo)
+   protected.CMX       = $(file $(name).cmx)
+   protected.CMI       = $(file $(name).cmi)
+   protected.MLI       = $(file $(name).mli)
+
+   protected.BYTE_TARGETS   = $(CMO)
+   protected.NATIVE_TARGETS = $(CMX) $(OBJ)
+
+   protected.TARGETS = $(CMI)
+
+   if $(NATIVE_ENABLED)
+       TARGETS += $(NATIVE_TARGETS)
+       export
+
+   if $(BYTE_ENABLED)
+       TARGETS += $(BYTE_TARGETS)
+       export
+
+   #
+   # Link commands
+   #
+   protected.BYTE_DEPS = $(CMOFILES)
+   $(BYTE_TARGETS): $(CMOFILES)
+      section rule
+         if $(or $(NATIVE_ENABLED), $(target-exists $(MLI)))
+             BYTE_DEPS += $(CMI)
+             export
+         else
+             BYTE_TARGETS += $(CMI)
+             export
+         $(BYTE_TARGETS): $(BYTE_DEPS)
+            $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
+                $(OCAMLCFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMO) $(OCamlLinkSort $(CMOFILES))
+
+   protected.NATIVE_DEPS = $(CMXFILES) $(OFILES)
+   $(NATIVE_TARGETS): $(NATIVE_DEPS)
+      section rule
+         if $(target-exists $(MLI))
+            NATIVE_DEPS += $(CMI)
+            export
+         else
+            NATIVE_TARGETS += $(CMI)
+            export
+         $(NATIVE_TARGETS): $(NATIVE_DEPS)
+            $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
+                $(OCAMLOPTFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMX) $(OCamlLinkSort $(CMXFILES))
+
+   $(CMI):
+      section rule
+         if $(target-exists $(MLI))
+            $(CMI): $(MLI) :scanner: scan-ocaml-$(name).mli
+                $(OCamlC) -c $<
+         elseif $(NATIVE_ENABLED)
+            $(NATIVE_TARGETS) $(CMI): $(NATIVE_DEPS)
+               $(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
+                   $(OCAMLOPTFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMX) $(OCamlLinkSort $(CMXFILES))
+         else
+            $(BYTE_TARGETS) $(CMI): $(BYTE_DEPS)
+               $(OCAMLFIND) $(OCAMLC) $(LAZY_OCAMLFINDFLAGS) $(PREFIXED_OCAMLPACKS) $(OCAMLFLAGS) \
+                   $(OCAMLCFLAGS) $(OCAML_LIB_FLAGS) -pack -o $(CMO) $(OCamlLinkSort $(CMOFILES))
+
+   return $(TARGETS)
+
+# Generate document by ocamldoc for some targets.
+#   title
+#       title for documents.
+#   path
+#       output directory for generated documents
+#   files
+#       ML modules name (without .ml)
+#   imageext
+#       image extention without "." if generate depend image from .dot.
+public.GenerateOcamldoc(title, path, files, ?imageext) =
+    protected.ML       = $(addsuffix .ml, $(files))
+    protected.MLI       = $(filter-exists $(addsuffix .mli, $(files)))
+    protected.DIR =
+    protected.DOT_FOUND = $(CheckProg dot)
+    protected.INDEX_HTML = $(dir $(path))$(DIRSEP)index.html
+
+    if $(not $(equal $(dir $(path)), $(dir $(CWD))))
+        if $(not $(file-exists $(path)))
+            eprintln(Error: Making sure target directory is exists. $(path) don\'t exists)
+            return
+        DIR = -d $(dir $(path))
+        export
+
+    depend.dot : $(ML) $(MLI)
+        $(OCAMLFIND) $(OCAMLDOC) $(PREFIXED_OCAMLINCLUDES) $(PREFIXED_OCAMLPACKS) \
+            -dot -dot-include-all -dot-reduce $+ -o $@
+
+    if $(and $(not $(equal $(imageext), $(EMPTY))), $(DOT_FOUND))
+        depend.$(imageext): depend.dot
+            dot -T$(imageext) $< -o $@
+        export
+
+    $(INDEX_HTML): $(ML) $(MLI)
+        $(OCAMLFIND) $(OCAMLDOC) -html $(PREFIXED_OCAMLINCLUDES) $(PREFIXED_OCAMLPACKS) \
+             -t $(title) $(DIR) -m A -stars -all-params -colorize-code $+
+
+    # add a clean rule
+    AutoClean()
+
+    clean:
+        rm -f $(dir $(path))$(DIRSEP)*html
+        rm -f $(dir $(path))$(DIRSEP)*css
+        rm -f depend.dot
+        rm -f depend.*
+
+    return $(INDEX_HTML) depend.dot
+
+# Generate install rule for library_name of ocamlfind library
+# that add or install given files.
+#
+# note:: files returned from this function include META file.
+#
+#     library_name
+#        name of library. already installed library or new library.
+#     files
+#        install or add files. You can use often $(OCamlPackageGeneratedFiles) or others.
+public.OCamlInstallPackage(name, files) =
+	targets[] = META $(files)
+
+	if $(defined INSTALLED)
+		$(Installed $(name)): $(targets)
+			$(OCAMLFIND) remove $(name)
+			section:
+				$(OCAMLFIND) install $(name) $(targets)
+				CreateInstalled($(name), $(targets))
+		install: $(Installed $(name))
+		uninstall:
+			rm -f $(Installed $(name))
+			$(OCAMLFIND) remove $(name)
+		export
+	else
+		install:
+			$(OCAMLFIND) remove $(name)
+			$(OCAMLFIND) install $(name) $(targets)
+		uninstall:
+			$(OCAMLFIND) remove $(name)
+
+# Generate install rule for parent library of ocamlfind library
+# that add given files to it.
+#
+# note:: files returned from this function don't include META file because
+#        rule added by this function is only add to exists package.
+#
+#     library_name
+#        name of parent library. already installed library only.
+#     files
+#        add files. You can use often $(OCamlPackageGeneratedFiles) or others.
+public.OCamlInstallParentPackage(name, files) =
+	targets[] = $(files)
+
+	if $(defined INSTALLED)
+		$(Installed $(name)): $(targets)
+			section:
+				$(OCAMLFIND) install -add $(name) $(targets)
+				CreateInstalled($(name), $(targets))
+		install: $(Installed $(name))
+		uninstall:
+			rm -f $(Installed $(name))
+			$(OCAMLFIND) remove $(name)
+		export
+	else
+		install:
+			$(OCAMLFIND) install -add $(name) $(targets)
+		uninstall:
+			$(OCAMLFIND) remove $(name)
diff --git a/MyOMake/MyUtil.om b/MyOMake/MyUtil.om
index 4107f73..4fe7479 100644
--- a/MyOMake/MyUtil.om
+++ b/MyOMake/MyUtil.om
@@ -1,38 +1,38 @@
-# Provide some useful functions to make cross platform programs.
-open build/C
-open configure/Configure
-
-# This section is executed by omake first running.
-# Type of the platform under executing OMake, but PLATFORM_TYPE differ from OSTYPE.
-# PLATFORM_TYPE is setted by one of value as follows;
-# Unix, Mac, Win32, Cygwin
-global.PLATFORM_TYPE =
-	switch $(OSTYPE)
-	case Unix
-		value $(RunCProg $"""
-#include <stdio.h>
-
-int main(int argc, char** argv) {
-#if defined(__APPLE__)
-	printf("Mac");
-#else
-	printf("Unix");
-#endif
-	return 0;
-}
-""")
-	default
-		value $(OSTYPE)
-
-# helper functions for checking current platform.
-IsMac() =
-	return $(equal $(PLATFORM_TYPE), Mac)
-
-IsUnix() =
-	return $(equal $(PLATFORM_TYPE), Unix)
-
-IsWin() =
-	return $(equal $(PLATFORM_TYPE), Win32)
-
-IsCygwin() =
-	return $(equal $(PLATFORM_TYPE), Cyngwin)
+# Provide some useful functions to make cross platform programs.
+open build/C
+open configure/Configure
+
+# This section is executed by omake first running.
+# Type of the platform under executing OMake, but PLATFORM_TYPE differ from OSTYPE.
+# PLATFORM_TYPE is setted by one of value as follows;
+# Unix, Mac, Win32, Cygwin
+global.PLATFORM_TYPE =
+	switch $(OSTYPE)
+	case Unix
+		value $(RunCProg $"""
+#include <stdio.h>
+
+int main(int argc, char** argv) {
+#if defined(__APPLE__)
+	printf("Mac");
+#else
+	printf("Unix");
+#endif
+	return 0;
+}
+""")
+	default
+		value $(OSTYPE)
+
+# helper functions for checking current platform.
+IsMac() =
+	return $(equal $(PLATFORM_TYPE), Mac)
+
+IsUnix() =
+	return $(equal $(PLATFORM_TYPE), Unix)
+
+IsWin() =
+	return $(equal $(PLATFORM_TYPE), Win32)
+
+IsCygwin() =
+	return $(equal $(PLATFORM_TYPE), Cyngwin)
diff --git a/OMakefile b/OMakefile
index c792a70..c24e3ff 100644
--- a/OMakefile
+++ b/OMakefile
@@ -1,37 +1,37 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-open MyOCaml
-
-########################################################################
-# Phony targets are scoped, so you probably want to declare them first.
-#
-NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-
-.PHONY: all install clean
-
-########################################################################
-# Subdirectories.
-# You may want to include some subdirectories in this project.
-# If so, define the subdirectory targets and uncomment this section.
-#
-
-.SUBDIRS: lib src test
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+open MyOCaml
+
+########################################################################
+# Phony targets are scoped, so you probably want to declare them first.
+#
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = true
+
+
+.PHONY: all install clean
+
+########################################################################
+# Subdirectories.
+# You may want to include some subdirectories in this project.
+# If so, define the subdirectory targets and uncomment this section.
+#
+
+.SUBDIRS: lib src test
diff --git a/OMakeroot b/OMakeroot
index e800acf..84a9d77 100644
--- a/OMakeroot
+++ b/OMakeroot
@@ -1,45 +1,45 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakeroot file.
-# You will not normally need to modify this file.
-# By default, your changes should be placed in the
-# OMakefile in this directory.
-#
-# If you decide to modify this file, note that it uses exactly
-# the same syntax as the OMakefile.
-#
-
-#
-# Include the standard installed configuration files.
-# Any of these can be deleted if you are not using them,
-# but you probably want to keep the Common file.
-#
-open configure/Configure
-open build/Common
-
-OMAKEPATH += $(dir ./MyOMake)
-#
-# The command-line variables are defined *after* the
-# standard configuration has been loaded.
-#
-DefineCommandVars()
-
-#
-# Include the OMakefile in this directory.
-#
-.SUBDIRS: .
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakeroot file.
+# You will not normally need to modify this file.
+# By default, your changes should be placed in the
+# OMakefile in this directory.
+#
+# If you decide to modify this file, note that it uses exactly
+# the same syntax as the OMakefile.
+#
+
+#
+# Include the standard installed configuration files.
+# Any of these can be deleted if you are not using them,
+# but you probably want to keep the Common file.
+#
+open configure/Configure
+open build/Common
+
+OMAKEPATH += $(dir ./MyOMake)
+#
+# The command-line variables are defined *after* the
+# standard configuration has been loaded.
+#
+DefineCommandVars()
+
+#
+# Include the OMakefile in this directory.
+#
+.SUBDIRS: .
diff --git a/README.md b/README.md
index 7751b7d..294d863 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
-# Json-ocaml  #
-
-Json read and write library for OCaml.
+# Json-ocaml  #
+
+Json read and write library for OCaml.
diff --git a/lib/OMakefile b/lib/OMakefile
index a771d68..9716a8a 100644
--- a/lib/OMakefile
+++ b/lib/OMakefile
@@ -1,30 +1,30 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-
-.PHONY: all lib clean
-
-################################################
-# Configuration.  You may want to modify any of these configuration
-# variables.
-#
-
-.SUBDIRS: baselib
-
-.DEFAULT: baselib/build/baselib.cmxa
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+
+.PHONY: all lib clean
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+
+.SUBDIRS: baselib
+
+.DEFAULT: baselib/build/baselib.cmxa
diff --git a/lib/baselib/OMakefile b/lib/baselib/OMakefile
index e9a5421..ab78303 100644
--- a/lib/baselib/OMakefile
+++ b/lib/baselib/OMakefile
@@ -1,85 +1,85 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-
-################################################
-# Configuration.  You may want to modify any of these configuration
-# variables.
-#
-.PHONY: all lib clean
-.SUBDIRS: src
-#
-# This project requires ocamlfind (default - false).
-#
-USE_OCAMLFIND = true
-#
-OCAMLPACKS[] =
-#     num
-#    pack2
-#
-if $(not $(OCAMLFIND_EXISTS))
-   eprintln(This project requires ocamlfind, but is was not found.)
-   eprintln(You need to install ocamlfind and run "omake --configure".)
-   exit 1
-
-#
-# Include path
-#
-# OCAMLINCLUDES += /usr/lib/ocaml
-
-#
-# Compile native or byte code?
-#
-# The default values are defined as follows:
-#
-NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-#
-# Various options
-#
-# OCAMLFLAGS    += -annot -bin-annot
-# OCAMLCFLAGS   +=
-# OCAMLOPTFLAGS +=
-# OCAML_LINK_FLAGS +=
-# OCAML_BYTE_LINK_FLAGS +=
-# OCAML_NATIVE_LINK_FLAGS +=
-
-################################################
-# Build an OCaml library
-#
-LIB = baselib
-#
-INSTALL_FILES = $(addprefix src/, $(OCamlPackageGeneratedFiles $(LIB), false))
-INSTALL_FILES += $(ls src/*mli)
-
-GENFILES = $(OCamlPackageGeneratedFiles  $(LIB), false)
-
-$(addprefix build/, $(GENFILES)): $(addprefix src/, $(GENFILES))
-	cp $(INSTALL_FILES) build/
-
-lib: $(OCamlPackageGeneratedFiles src/$(LIB), false)
-	cp $(INSTALL_FILES) build/
-
-clean:
-	cd build/
-
-all: lib
-
-.DEFAULT: all
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+.PHONY: all lib clean
+.SUBDIRS: src
+#
+# This project requires ocamlfind (default - false).
+#
+USE_OCAMLFIND = true
+#
+OCAMLPACKS[] =
+#     num
+#    pack2
+#
+if $(not $(OCAMLFIND_EXISTS))
+   eprintln(This project requires ocamlfind, but is was not found.)
+   eprintln(You need to install ocamlfind and run "omake --configure".)
+   exit 1
+
+#
+# Include path
+#
+# OCAMLINCLUDES += /usr/lib/ocaml
+
+#
+# Compile native or byte code?
+#
+# The default values are defined as follows:
+#
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = true
+
+#
+# Various options
+#
+# OCAMLFLAGS    += -annot -bin-annot
+# OCAMLCFLAGS   +=
+# OCAMLOPTFLAGS +=
+# OCAML_LINK_FLAGS +=
+# OCAML_BYTE_LINK_FLAGS +=
+# OCAML_NATIVE_LINK_FLAGS +=
+
+################################################
+# Build an OCaml library
+#
+LIB = baselib
+#
+INSTALL_FILES = $(addprefix src/, $(OCamlPackageGeneratedFiles $(LIB), false))
+INSTALL_FILES += $(ls src/*mli)
+
+GENFILES = $(OCamlPackageGeneratedFiles  $(LIB), false)
+
+$(addprefix build/, $(GENFILES)): $(addprefix src/, $(GENFILES))
+	cp $(INSTALL_FILES) build/
+
+lib: $(OCamlPackageGeneratedFiles src/$(LIB), false)
+	cp $(INSTALL_FILES) build/
+
+clean:
+	cd build/
+
+all: lib
+
+.DEFAULT: all
diff --git a/lib/baselib/build/binary_pack.mli b/lib/baselib/build/binary_pack.mli
index e2ce6e9..deda6fc 100644
--- a/lib/baselib/build/binary_pack.mli
+++ b/lib/baselib/build/binary_pack.mli
@@ -1,211 +1,211 @@
-(** Utility functions for conversion binary data to OCaml data, or OCaml data to binary data.
-    These functions are used with in/out channel and binary readed buffer.
-
-    In addition, this module include conversion function for to convert C-type float (4byte).
-
-    This module privides functions for string to pack and unpack values.
-
-    @author derui
-    @version 0.2
-*)
-
-(** endianness of binary data *)
-type endian = Little_endian | Big_endian
-
-(** Exception for invalid byte position when calculate offset *)
-exception Binary_pack_invalid_byte_range of int
-exception Binary_pack_invalid_short_range of int
-exception Binary_pack_invalid_unsigned_short_range of int
-exception Binary_pack_invalid_int_position of int
-exception Binary_pack_invalid_int64_position of int
-exception Binary_pack_invalid_float_position of int
-
-(** Exception for invalid buffer position to write unpacked value. *)
-exception Binary_pack_invalid_buffer_position of int
-
-
-(** The module is used by argument for Binary_pack functions
-    instead of charactor array that equals string.
-*)
-module type BinaryArray = sig
-  type t
-  val length: t -> int
-  val get: t -> int -> char
-  val set: t -> int -> char -> unit
-end
-
-(** Functions that is used to pack and unpack values.
-*)
-module type S = sig
-  type t
-
-  (** Pack unsigned char data of the buffer at pos to OCaml int.
-      Use a element of the buffer.
-      Limits packed value between 0 to 255.
-
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_byte_position
-  *)
-  val unpack_unsigned_8 : buffer:t -> pos:int -> int
-
-  (** Unpack unsigned char data by given OCaml int, and
-      write unpacked value to the buffer at the pos.
-      Limits unpacked value between 0 to 255.
-      If given value to pack is greater than 255, write 0 to buffer.
-
-      @param buffer the buffer to write unpacked value
-      @param pos the position at the buffer to write unpacked value
-      @param value the value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed char data of the buffer at pos to OCaml int.
-      see {!pack_unsigned_8}
-  *)
-  val unpack_signed_8 : buffer:t -> pos:int -> int
-
-  (** Unpack signed char data of the buffer at pos to OCaml int.
-      see {!pack_unsigned_8}
-  *)
-  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed short data of the buffer at pos to OCaml int.
-      Use two element beginning of the buffer from pos.
-      Limits packed value between 32767 to -32768.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_byte_position
-  *)
-  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
-
-  (** Unpack signed short data from given OCaml int.
-      Write unpacked value to the buffer from the pos
-      Limits packed value between 32767 to -32768.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_short_position
-  *)
-  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** see {!pack_signed_16} *)
-  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
-  (** see {!unpack_signed_16} *)
-  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed integer data of the buffer at pos to int32.
-      Use four element beginning of the buffer from pos.
-      Limits packed value between 2^31-1 to -2^31
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^31-1 to -2^31
-      @raise Bnary_pack_invalid_int_position
-  *)
-  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
-  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
-
-  (** Unpack signed integer data from given int32 or OCaml int, and
-      write unpacked value to the buvver from the pos.
-      Limits packed value between 2^31-1 to -2^31
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the integer value to unpack between 2^31-1 to -2^31
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
-  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed 64bit integer data of the buffer at pos to int64.
-      Use four element beginning of the buffer from pos.
-      Limits packed value between 2^63-1 to -2^63
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_int64_position
-  *)
-  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
-
-  (** Unpack signed integer data from given int64, and
-      write unpacked value to the buvver from the pos.
-      Limits packed value between 2^63-1 to -2^63
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the integer value to unpack between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
-
-  (** Pack double precision floating number of the buffer at pos to float.
-      Use eight element beginning of the buffer from pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_float_position
-  *)
-  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
-
-  (** Unpack double precision floating number from given float, and
-      write unpacked value to the buffer from the pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the floating value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-
-  (** Pack uni precision floating number of the buffer at pos to float.
-      Use four element beginning of the buffer from pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value
-      @raise Bnary_pack_invalid_float_position
-  *)
-  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
-
-  (** Unpack uni precision floating number from given float, and
-      write unpacked value to the buffer from the pos.
-      Limits packed value to ocaml float.
-
-      Note: This function convert double precision floating number to uni,
-      so unpacked value drop off some precision value from original.
-      Therefore, there is not able to recover dropped off some precision.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the floating value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-
-end
-
-(** The functor make functions for given binary array. *)
-module Make(A:BinaryArray) : S with type t = A.t
-
-include S with type t = string
+(** Utility functions for conversion binary data to OCaml data, or OCaml data to binary data.
+    These functions are used with in/out channel and binary readed buffer.
+
+    In addition, this module include conversion function for to convert C-type float (4byte).
+
+    This module privides functions for string to pack and unpack values.
+
+    @author derui
+    @version 0.2
+*)
+
+(** endianness of binary data *)
+type endian = Little_endian | Big_endian
+
+(** Exception for invalid byte position when calculate offset *)
+exception Binary_pack_invalid_byte_range of int
+exception Binary_pack_invalid_short_range of int
+exception Binary_pack_invalid_unsigned_short_range of int
+exception Binary_pack_invalid_int_position of int
+exception Binary_pack_invalid_int64_position of int
+exception Binary_pack_invalid_float_position of int
+
+(** Exception for invalid buffer position to write unpacked value. *)
+exception Binary_pack_invalid_buffer_position of int
+
+
+(** The module is used by argument for Binary_pack functions
+    instead of charactor array that equals string.
+*)
+module type BinaryArray = sig
+  type t
+  val length: t -> int
+  val get: t -> int -> char
+  val set: t -> int -> char -> unit
+end
+
+(** Functions that is used to pack and unpack values.
+*)
+module type S = sig
+  type t
+
+  (** Pack unsigned char data of the buffer at pos to OCaml int.
+      Use a element of the buffer.
+      Limits packed value between 0 to 255.
+
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_byte_position
+  *)
+  val unpack_unsigned_8 : buffer:t -> pos:int -> int
+
+  (** Unpack unsigned char data by given OCaml int, and
+      write unpacked value to the buffer at the pos.
+      Limits unpacked value between 0 to 255.
+      If given value to pack is greater than 255, write 0 to buffer.
+
+      @param buffer the buffer to write unpacked value
+      @param pos the position at the buffer to write unpacked value
+      @param value the value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed char data of the buffer at pos to OCaml int.
+      see {!pack_unsigned_8}
+  *)
+  val unpack_signed_8 : buffer:t -> pos:int -> int
+
+  (** Unpack signed char data of the buffer at pos to OCaml int.
+      see {!pack_unsigned_8}
+  *)
+  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed short data of the buffer at pos to OCaml int.
+      Use two element beginning of the buffer from pos.
+      Limits packed value between 32767 to -32768.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_byte_position
+  *)
+  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
+
+  (** Unpack signed short data from given OCaml int.
+      Write unpacked value to the buffer from the pos
+      Limits packed value between 32767 to -32768.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_short_position
+  *)
+  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** see {!pack_signed_16} *)
+  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
+  (** see {!unpack_signed_16} *)
+  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed integer data of the buffer at pos to int32.
+      Use four element beginning of the buffer from pos.
+      Limits packed value between 2^31-1 to -2^31
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^31-1 to -2^31
+      @raise Bnary_pack_invalid_int_position
+  *)
+  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
+  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
+
+  (** Unpack signed integer data from given int32 or OCaml int, and
+      write unpacked value to the buvver from the pos.
+      Limits packed value between 2^31-1 to -2^31
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the integer value to unpack between 2^31-1 to -2^31
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
+  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed 64bit integer data of the buffer at pos to int64.
+      Use four element beginning of the buffer from pos.
+      Limits packed value between 2^63-1 to -2^63
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_int64_position
+  *)
+  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
+
+  (** Unpack signed integer data from given int64, and
+      write unpacked value to the buvver from the pos.
+      Limits packed value between 2^63-1 to -2^63
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the integer value to unpack between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
+
+  (** Pack double precision floating number of the buffer at pos to float.
+      Use eight element beginning of the buffer from pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_float_position
+  *)
+  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
+
+  (** Unpack double precision floating number from given float, and
+      write unpacked value to the buffer from the pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the floating value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+
+  (** Pack uni precision floating number of the buffer at pos to float.
+      Use four element beginning of the buffer from pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value
+      @raise Bnary_pack_invalid_float_position
+  *)
+  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
+
+  (** Unpack uni precision floating number from given float, and
+      write unpacked value to the buffer from the pos.
+      Limits packed value to ocaml float.
+
+      Note: This function convert double precision floating number to uni,
+      so unpacked value drop off some precision value from original.
+      Therefore, there is not able to recover dropped off some precision.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the floating value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+
+end
+
+(** The functor make functions for given binary array. *)
+module Make(A:BinaryArray) : S with type t = A.t
+
+include S with type t = string
diff --git a/lib/baselib/build/collection.mli b/lib/baselib/build/collection.mli
index d7b1509..61eb774 100644
--- a/lib/baselib/build/collection.mli
+++ b/lib/baselib/build/collection.mli
@@ -1,45 +1,45 @@
-(** base operations and collection type for module of Collection. *)
-module type Type =
-sig
-  type t
-  type elt
-  (** left side parenthesis when convert elt to string *)
-  val lparen : string
-  (** right side parenthesis when convert elt to string *)
-  val rparen : string
-  (** separate each elt when convert elt to string *)
-  val separator : string
-  (** return empty collection *)
-  val empty : t
-  (** add element for elt to t *)
-  val add : elt -> t -> t
-  (** apply each element of t with first element is 'a *)
-  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
-  include Stringable.Type with type t := elt
-end
-
-module type S =
-sig
-  type elt
-  type t
-  (** folding with index of element in t *)
-  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
-  (** execute affects with index of element of t *)
-  val iteri : (int -> elt -> unit) -> t -> unit
-  (** append element to t if arg is Some. *)
-  val add_option : elt option -> t -> t
-  (** convert t from list. *)
-  val of_list : elt list -> t
-  (** convert list from t *)
-  val to_list : t -> elt list
-  (** add all element of list to given t. *)
-  val add_list : elt list -> t -> t
-  (** translate given lparen, rparen, separator and t into string. *)
-  val to_string_sep : string -> string -> string -> t -> string
-
-  (** Stringable Signatures *)
-  include Stringable.Type with type t:= t
-  include Stringable.S with type t := t
-end
-
-module Make (T:Type) : S with type elt := T.elt and type t := T.t
+(** base operations and collection type for module of Collection. *)
+module type Type =
+sig
+  type t
+  type elt
+  (** left side parenthesis when convert elt to string *)
+  val lparen : string
+  (** right side parenthesis when convert elt to string *)
+  val rparen : string
+  (** separate each elt when convert elt to string *)
+  val separator : string
+  (** return empty collection *)
+  val empty : t
+  (** add element for elt to t *)
+  val add : elt -> t -> t
+  (** apply each element of t with first element is 'a *)
+  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
+  include Stringable.Type with type t := elt
+end
+
+module type S =
+sig
+  type elt
+  type t
+  (** folding with index of element in t *)
+  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
+  (** execute affects with index of element of t *)
+  val iteri : (int -> elt -> unit) -> t -> unit
+  (** append element to t if arg is Some. *)
+  val add_option : elt option -> t -> t
+  (** convert t from list. *)
+  val of_list : elt list -> t
+  (** convert list from t *)
+  val to_list : t -> elt list
+  (** add all element of list to given t. *)
+  val add_list : elt list -> t -> t
+  (** translate given lparen, rparen, separator and t into string. *)
+  val to_string_sep : string -> string -> string -> t -> string
+
+  (** Stringable Signatures *)
+  include Stringable.Type with type t:= t
+  include Stringable.S with type t := t
+end
+
+module Make (T:Type) : S with type elt := T.elt and type t := T.t
diff --git a/lib/baselib/build/comparable.mli b/lib/baselib/build/comparable.mli
index 50a1c0f..f4b2d97 100644
--- a/lib/baselib/build/comparable.mli
+++ b/lib/baselib/build/comparable.mli
@@ -1,86 +1,86 @@
-(** this module is used to functor when needs some modules to compare
-    t.
-
-    usage: when you want to add compareable ability into module,
-    include with applying Make that is in this module.
-
-    include Compareable.Make(...)
-*)
-
-type ('a, 'unique_id) t = ('a -> 'a -> int)
-
-(** avoid circular reference, only using inner this module.  *)
-type ('a, 'unique_id) t_ = ('a, 'unique_id) t
-
-(** Provide type-specific function to compare  *)
-module type Type =
-sig
-  type t
-  (** compare elements. if first is less than second, return -1.
-      if first equal second, return 0.
-      return 1 if first is greater than second.
-  *)
-  val compare : t -> t -> int
-end
-
-(** Signature of some functions to compare each specified type *)
-module type S =
-sig
-  type t
-  type comparator
-  val comparator: (t, comparator) t_
-  (** equals between elements *)
-  val eq : t -> t -> bool
-  (** not equals between elements *)
-  val ne : t -> t -> bool
-  (** first element is greater than second *)
-  val gt : t -> t -> bool
-  (** first element is greater equal second *)
-  val ge : t -> t -> bool
-  (** first element is less than second *)
-  val lt : t -> t -> bool
-  (** first element is less equal second *)
-  val le : t -> t -> bool
-
-end
-
-(** Signature of some functions to compare to have a variable type. *)
-module type S1 =
-sig
-  (** element type of this signature. this is had to overwrite when
-      using any module. *)
-  type 'a t
-  type comparator
-  val comparator: ('a t, comparator) t_
-  (** equals between elements *)
-  val eq : 'a t -> 'a t -> bool
-  (** not equals between elements *)
-  val ne : 'a t -> 'a t -> bool
-  (** first element is greater than second *)
-  val gt : 'a t -> 'a t -> bool
-  (** first element is greater equal second *)
-  val ge : 'a t -> 'a t -> bool
-  (** first element is less than second *)
-  val lt : 'a t -> 'a t -> bool
-  (** first element is less equal second *)
-  val le : 'a t -> 'a t -> bool
-
-end
-
-(** comparable module for primitive types that
-    is able to apply polymorphismical Perversive's compare to it.
-*)
-module Poly : S1 with type 'a t = 'a
-
-(** using this module when need order functions. *)
-module Make (T : Type) : S with type t = T.t
-
-(** Use this module to get type-specified comparable module  *)
-module Make1 (T : sig
-  type 'a t
-  val compare : 'a t -> 'a t -> int
-end) : S1 with type 'a t = 'a T.t
-
-(** Convert {!S} to {!S1} *)
-module S_to_S1 (T: S) : S1 with type 'a t = T.t
-                           and type comparator = T.comparator
+(** this module is used to functor when needs some modules to compare
+    t.
+
+    usage: when you want to add compareable ability into module,
+    include with applying Make that is in this module.
+
+    include Compareable.Make(...)
+*)
+
+type ('a, 'unique_id) t = ('a -> 'a -> int)
+
+(** avoid circular reference, only using inner this module.  *)
+type ('a, 'unique_id) t_ = ('a, 'unique_id) t
+
+(** Provide type-specific function to compare  *)
+module type Type =
+sig
+  type t
+  (** compare elements. if first is less than second, return -1.
+      if first equal second, return 0.
+      return 1 if first is greater than second.
+  *)
+  val compare : t -> t -> int
+end
+
+(** Signature of some functions to compare each specified type *)
+module type S =
+sig
+  type t
+  type comparator
+  val comparator: (t, comparator) t_
+  (** equals between elements *)
+  val eq : t -> t -> bool
+  (** not equals between elements *)
+  val ne : t -> t -> bool
+  (** first element is greater than second *)
+  val gt : t -> t -> bool
+  (** first element is greater equal second *)
+  val ge : t -> t -> bool
+  (** first element is less than second *)
+  val lt : t -> t -> bool
+  (** first element is less equal second *)
+  val le : t -> t -> bool
+
+end
+
+(** Signature of some functions to compare to have a variable type. *)
+module type S1 =
+sig
+  (** element type of this signature. this is had to overwrite when
+      using any module. *)
+  type 'a t
+  type comparator
+  val comparator: ('a t, comparator) t_
+  (** equals between elements *)
+  val eq : 'a t -> 'a t -> bool
+  (** not equals between elements *)
+  val ne : 'a t -> 'a t -> bool
+  (** first element is greater than second *)
+  val gt : 'a t -> 'a t -> bool
+  (** first element is greater equal second *)
+  val ge : 'a t -> 'a t -> bool
+  (** first element is less than second *)
+  val lt : 'a t -> 'a t -> bool
+  (** first element is less equal second *)
+  val le : 'a t -> 'a t -> bool
+
+end
+
+(** comparable module for primitive types that
+    is able to apply polymorphismical Perversive's compare to it.
+*)
+module Poly : S1 with type 'a t = 'a
+
+(** using this module when need order functions. *)
+module Make (T : Type) : S with type t = T.t
+
+(** Use this module to get type-specified comparable module  *)
+module Make1 (T : sig
+  type 'a t
+  val compare : 'a t -> 'a t -> int
+end) : S1 with type 'a t = 'a T.t
+
+(** Convert {!S} to {!S1} *)
+module S_to_S1 (T: S) : S1 with type 'a t = T.t
+                           and type comparator = T.comparator
diff --git a/lib/baselib/build/compareStringable.mli b/lib/baselib/build/compareStringable.mli
index abae484..fd0c6ce 100644
--- a/lib/baselib/build/compareStringable.mli
+++ b/lib/baselib/build/compareStringable.mli
@@ -1,25 +1,25 @@
-(** add ability that can compare and convert module.t to string *)
-
-(** Interface for Functor to apply to Make module  *)
-module type Type =
-  sig
-    (** add compareable ability between same module.t  *)
-    include Comparable.Type
-    (** add stringable ability that can convert module.t to string  *)
-    include Stringable.Type with type t := t
-  end
-
-(** Module implementation interface  *)
-module type S =
-  sig
-    include Comparable.S
-    include Stringable.S with type t := t
-  end
-
-(**
-   Make module that add compareable and stringable ability to
-   target module.
-   Prepareing Functor that implemented to Type before make new added
-   module!
-*)
-module Make (T:Type) : S with type t := T.t
+(** add ability that can compare and convert module.t to string *)
+
+(** Interface for Functor to apply to Make module  *)
+module type Type =
+  sig
+    (** add compareable ability between same module.t  *)
+    include Comparable.Type
+    (** add stringable ability that can convert module.t to string  *)
+    include Stringable.Type with type t := t
+  end
+
+(** Module implementation interface  *)
+module type S =
+  sig
+    include Comparable.S
+    include Stringable.S with type t := t
+  end
+
+(**
+   Make module that add compareable and stringable ability to
+   target module.
+   Prepareing Functor that implemented to Type before make new added
+   module!
+*)
+module Make (T:Type) : S with type t := T.t
diff --git a/lib/baselib/build/either.mli b/lib/baselib/build/either.mli
index e5e1da7..decb195 100644
--- a/lib/baselib/build/either.mli
+++ b/lib/baselib/build/either.mli
@@ -1,51 +1,51 @@
-(** Provide culculation have two way result with type and relative
-    functions for it.
-    And Either providing monadic interface as {!Monad} module.
-
-    Either Monad woking as follows:
-
-    | Left  ->  finishing bind chain and return as Left
-    | Right ->  continue bind chain applied function to Right value
-
-    @author derui
-    @since 0.1
-*)
-
-(** Have two way result. Often Left is failed to culculate and
-    error message, Right as `right' calculation with calculated
-    result.
-
-    Note: Please look cautious type variant of {Either.t} before  use
-    it. Sorry the variant arrangements is not very understand that
-    the first type variant is for {b Right}, and second it is for {b
-    Left}. Reason of this design is to add monadic interface to
-    Either. (Added monadic interface here detail locate in {!monad} module.)
-*)
-type ('a, 'b) t =
-| Left of 'b
-| Right of 'a
-
-(**
-   If given {!either} is left, return applied {!f} to Left value.
-   Return None if given {!either} is Right.
-*)
-val either_left : ('a, 'b) t -> ('b -> 'c) -> 'c option
-
-(**
-   If given {!either} is Right, return applied {!f} to Right value.
-   Return None if given {!either} is Left.
-*)
-val either_right : ('a, 'b) t -> ('a -> 'c) -> 'c option
-
-(**
-   Return the given {!either} is {!Left} or not.
-*)
-val is_left : ('a, 'b) t -> bool
-
-(**
-   Return the given {!either} is {!Right} or not.
-*)
-val is_right : ('a, 'b) t -> bool
-
-(** For Monadic operations *)
-include Monad_intf.S2 with type ('a, 'b) t := ('a, 'b) t
+(** Provide culculation have two way result with type and relative
+    functions for it.
+    And Either providing monadic interface as {!Monad} module.
+
+    Either Monad woking as follows:
+
+    | Left  ->  finishing bind chain and return as Left
+    | Right ->  continue bind chain applied function to Right value
+
+    @author derui
+    @since 0.1
+*)
+
+(** Have two way result. Often Left is failed to culculate and
+    error message, Right as `right' calculation with calculated
+    result.
+
+    Note: Please look cautious type variant of {Either.t} before  use
+    it. Sorry the variant arrangements is not very understand that
+    the first type variant is for {b Right}, and second it is for {b
+    Left}. Reason of this design is to add monadic interface to
+    Either. (Added monadic interface here detail locate in {!monad} module.)
+*)
+type ('a, 'b) t =
+| Left of 'b
+| Right of 'a
+
+(**
+   If given {!either} is left, return applied {!f} to Left value.
+   Return None if given {!either} is Right.
+*)
+val either_left : ('a, 'b) t -> ('b -> 'c) -> 'c option
+
+(**
+   If given {!either} is Right, return applied {!f} to Right value.
+   Return None if given {!either} is Left.
+*)
+val either_right : ('a, 'b) t -> ('a -> 'c) -> 'c option
+
+(**
+   Return the given {!either} is {!Left} or not.
+*)
+val is_left : ('a, 'b) t -> bool
+
+(**
+   Return the given {!either} is {!Right} or not.
+*)
+val is_right : ('a, 'b) t -> bool
+
+(** For Monadic operations *)
+include Monad_intf.S2 with type ('a, 'b) t := ('a, 'b) t
diff --git a/lib/baselib/build/ext_array.mli b/lib/baselib/build/ext_array.mli
index 9130af5..e0e76bb 100644
--- a/lib/baselib/build/ext_array.mli
+++ b/lib/baselib/build/ext_array.mli
@@ -1,36 +1,36 @@
-(** Provide some functions for ocaml array.
-    Containing functions provided are not included Array module of the stdlib.
-
-    @author derui
-    @version 0.2
-*)
-
-(** Remove an element at an given index and return new array removed element.
-    This function uses Array.blit twice for coping array.
-
-    @param array an array to remove an element from
-    @param index the index of an element to remove from array
-    @param init an element to initialize new array.
-    @return new array that is copied original array without a removed element.
-*)
-val remove : 'a array -> index:int -> init:'a -> 'a array
-
-(** Add an element to tail of the array and return new one.
-    Therefore this function is very slow because it copies given array
-    to new array that size is more larger than original one.
-
-    @param array the array to add an element to.
-    @param element the element to add to the array
-    @return new array added a given element.
-*)
-val add : 'a array -> 'a -> 'a array
-
-(** combine_map a b f traverse each element of arrays and apply function.
-    Sequence for applying function to elements of arrays is `f a1 b1', `f a1 b2`... and then
-    `f a2 b1', therefore, count what combine_omap apply function is multiply length of a to length of b,
-    is equal to 110 if length of a is 11 and length b is 10.
-
-    NOTE: combine_map is used to need to apply function all combination of elements of two arrays.
-    So you have to think amount of calculation when use this function.
-*)
-val combine_map: 'a array -> 'b array -> ('a -> 'b -> 'c) -> 'c array
+(** Provide some functions for ocaml array.
+    Containing functions provided are not included Array module of the stdlib.
+
+    @author derui
+    @version 0.2
+*)
+
+(** Remove an element at an given index and return new array removed element.
+    This function uses Array.blit twice for coping array.
+
+    @param array an array to remove an element from
+    @param index the index of an element to remove from array
+    @param init an element to initialize new array.
+    @return new array that is copied original array without a removed element.
+*)
+val remove : 'a array -> index:int -> init:'a -> 'a array
+
+(** Add an element to tail of the array and return new one.
+    Therefore this function is very slow because it copies given array
+    to new array that size is more larger than original one.
+
+    @param array the array to add an element to.
+    @param element the element to add to the array
+    @return new array added a given element.
+*)
+val add : 'a array -> 'a -> 'a array
+
+(** combine_map a b f traverse each element of arrays and apply function.
+    Sequence for applying function to elements of arrays is `f a1 b1', `f a1 b2`... and then
+    `f a2 b1', therefore, count what combine_omap apply function is multiply length of a to length of b,
+    is equal to 110 if length of a is 11 and length b is 10.
+
+    NOTE: combine_map is used to need to apply function all combination of elements of two arrays.
+    So you have to think amount of calculation when use this function.
+*)
+val combine_map: 'a array -> 'b array -> ('a -> 'b -> 'c) -> 'c array
diff --git a/lib/baselib/build/ext_list.mli b/lib/baselib/build/ext_list.mli
index b0bb91e..c128973 100644
--- a/lib/baselib/build/ext_list.mli
+++ b/lib/baselib/build/ext_list.mli
@@ -1,31 +1,31 @@
-(** Extention for List.
-    Contained some extentional functions for {!List},
-    and utility for List.
-
-    All functions in this module are integrated with {!List} where
-    be in {!Std} module.
-*)
-
-(** return list within the compass of given min to given max. *)
-val range : Num.num * Num.num -> Num.num list
-
-(** range specified for int. detail behavior equals {!range} *)
-val range_int : int * int -> int list
-
-(** range of float values are specified by each value step, start and end of range.  *)
-val range_float : step:float -> fromto:float * float -> float list
-
-(**
-   initialization list. this return list that applied each \[0..n) to
-   f. it likes \[f(0);f(1);..f(n-1)\]
-*)
-val init : int -> (int -> 'a) -> 'a list
-
-(** return list within the compass of given min to given max.
-    This function is alias to {!range_int}
-*)
-val (--) : int -> int -> int list
-
-(** This function is alias to {!range}
-*)
-val (--/) : Num.num -> Num.num -> Num.num list
+(** Extention for List.
+    Contained some extentional functions for {!List},
+    and utility for List.
+
+    All functions in this module are integrated with {!List} where
+    be in {!Std} module.
+*)
+
+(** return list within the compass of given min to given max. *)
+val range : Num.num * Num.num -> Num.num list
+
+(** range specified for int. detail behavior equals {!range} *)
+val range_int : int * int -> int list
+
+(** range of float values are specified by each value step, start and end of range.  *)
+val range_float : step:float -> fromto:float * float -> float list
+
+(**
+   initialization list. this return list that applied each \[0..n) to
+   f. it likes \[f(0);f(1);..f(n-1)\]
+*)
+val init : int -> (int -> 'a) -> 'a list
+
+(** return list within the compass of given min to given max.
+    This function is alias to {!range_int}
+*)
+val (--) : int -> int -> int list
+
+(** This function is alias to {!range}
+*)
+val (--/) : Num.num -> Num.num -> Num.num list
diff --git a/lib/baselib/build/ext_map.mli b/lib/baselib/build/ext_map.mli
index 7988256..8fba58c 100644
--- a/lib/baselib/build/ext_map.mli
+++ b/lib/baselib/build/ext_map.mli
@@ -1,73 +1,73 @@
-(** This module define [Map] module for [Baselib.Std]. I named after {!Ext_map}
-    because don't override Original Caml {!Map} module.
-
-    Internal structure defined this module is based on 'red-black tree',
-    so all operation to defined Map by this module are O(log n) at worst.
-
-    All defined operations has label-interface and first-container arguments that
-    is locate first in operation's arguments.
-
-    Usage:
-
-    1. want map to use Pervasive.compare
-         type map = ('a ,'b) Baselib.Std.Map.Poly.t
-       or
-         module M = Baselib.Std.Map.Poly
-    2. want map with using own comparable module.
-         module M = Baselib.Std.Map.Make(Type)
-    3. want module interface to write for .mli
-         module M : Baselib.Std.Map.S with type Key.t = {b key}
-       in ml,
-         module M = Baselib.Std.Map.Make(struct
-           type t = {b key}
-           let compare = ...
-         end)
-       // Using key you want is as {b key}.
-
-    @author derui
-    @since 0.1
-*)
-
-open Ext_map_intf
-
-(** type for generic map  *)
-type ('k, +'v, 'comparator) t
-type 'k key = 'k
-type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
-
-include Creator with type ('k, 'v, 'comparator) t := ('k, 'v, 'comparator) t
-                and type 'k key := 'k key
-                and type ('a, 'comparator, 'z) create := ('a, 'comparator, 'z) create
-
-include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t
-                 and type 'k key := 'k key
-
-
-module type Key = Key
-(** Used by to make key-specified {!Map} module by {!Make} *)
-module type S = S with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
-
-(** Make key-specified module with functor implemented
-    compare between a key and define the type of key
-*)
-module Make(Key:Key) : S with type Key.t = Key.t
-
-module Make_use_comparator(Key:Comparable.S) : S
-  with type Key.t = Key.t
-  and type Key.comparator = Key.comparator
-
-module Poly : sig
-  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
-  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
-  type ('a, 'b, 'c) t_ = ('a, 'b) t
-  type 'a key = 'a
-  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
-
-  include Creator with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
-                  and type 'a key := 'a key
-                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
-
-  include Accessor with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
-                   and type 'a key := 'a key
-end
-  with type ('a, 'b, 'c) map = ('a, 'b, 'c) t
+(** This module define [Map] module for [Baselib.Std]. I named after {!Ext_map}
+    because don't override Original Caml {!Map} module.
+
+    Internal structure defined this module is based on 'red-black tree',
+    so all operation to defined Map by this module are O(log n) at worst.
+
+    All defined operations has label-interface and first-container arguments that
+    is locate first in operation's arguments.
+
+    Usage:
+
+    1. want map to use Pervasive.compare
+         type map = ('a ,'b) Baselib.Std.Map.Poly.t
+       or
+         module M = Baselib.Std.Map.Poly
+    2. want map with using own comparable module.
+         module M = Baselib.Std.Map.Make(Type)
+    3. want module interface to write for .mli
+         module M : Baselib.Std.Map.S with type Key.t = {b key}
+       in ml,
+         module M = Baselib.Std.Map.Make(struct
+           type t = {b key}
+           let compare = ...
+         end)
+       // Using key you want is as {b key}.
+
+    @author derui
+    @since 0.1
+*)
+
+open Ext_map_intf
+
+(** type for generic map  *)
+type ('k, +'v, 'comparator) t
+type 'k key = 'k
+type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
+
+include Creator with type ('k, 'v, 'comparator) t := ('k, 'v, 'comparator) t
+                and type 'k key := 'k key
+                and type ('a, 'comparator, 'z) create := ('a, 'comparator, 'z) create
+
+include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t
+                 and type 'k key := 'k key
+
+
+module type Key = Key
+(** Used by to make key-specified {!Map} module by {!Make} *)
+module type S = S with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
+
+(** Make key-specified module with functor implemented
+    compare between a key and define the type of key
+*)
+module Make(Key:Key) : S with type Key.t = Key.t
+
+module Make_use_comparator(Key:Comparable.S) : S
+  with type Key.t = Key.t
+  and type Key.comparator = Key.comparator
+
+module Poly : sig
+  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
+  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
+  type ('a, 'b, 'c) t_ = ('a, 'b) t
+  type 'a key = 'a
+  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
+
+  include Creator with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
+                  and type 'a key := 'a key
+                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
+
+  include Accessor with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
+                   and type 'a key := 'a key
+end
+  with type ('a, 'b, 'c) map = ('a, 'b, 'c) t
diff --git a/lib/baselib/build/float.mli b/lib/baselib/build/float.mli
index f7b264c..1730436 100644
--- a/lib/baselib/build/float.mli
+++ b/lib/baselib/build/float.mli
@@ -1,17 +1,17 @@
-(**
-   Provide some functions for operation with float.
-
-   @author derui
-   @version 0.1
-*)
-
-(** Compare two float. Argument epsilon is maximum difference with two float
-    allowed to equal to two float.
-    The default value of epsilon is 0.000001, then you specify epsilon if you need more or less accuracy.
-
-    @param f1 a float to compare with another float
-    @param f2 a float to compare with another float
-    @param epsilon maximum difference between two float to be allowed equivalent
-    @return -1 if f1 is less than f2, 1 if f1 is greater than f2, 0 if f1 equal to f2
-*)
-val compare : ?epsilon:float -> float -> float -> int
+(**
+   Provide some functions for operation with float.
+
+   @author derui
+   @version 0.1
+*)
+
+(** Compare two float. Argument epsilon is maximum difference with two float
+    allowed to equal to two float.
+    The default value of epsilon is 0.000001, then you specify epsilon if you need more or less accuracy.
+
+    @param f1 a float to compare with another float
+    @param f2 a float to compare with another float
+    @param epsilon maximum difference between two float to be allowed equivalent
+    @return -1 if f1 is less than f2, 1 if f1 is greater than f2, 0 if f1 equal to f2
+*)
+val compare : ?epsilon:float -> float -> float -> int
diff --git a/lib/baselib/build/input_channel.mli b/lib/baselib/build/input_channel.mli
index b7ddba6..0fa8233 100644
--- a/lib/baselib/build/input_channel.mli
+++ b/lib/baselib/build/input_channel.mli
@@ -1,40 +1,40 @@
-(** Implements functions for input channel as extended Pervasive's.
-    Provided functions are able to split some categories, such as
-    binary, text, and useful input funcitons.
-
-    @author derui
-    @version 0.2
-*)
-
-(** Read exactly len charactors from current position of the input channel.
-    If in_channel reached end of file, return None.
-
-    @param chan input channel to read charactors
-    @param len reading length from input channel
-    @return readed charactors
-*)
-val read : chan:in_channel -> len:int -> string option
-
-(** This sets the current reading position to pos for channel chan.
-    You can select some methods to detect setting the current reading position as follows:
-    `Current -> Set the current reading position to add pos to the current reading position.
-    `Head -> Set the current reading position to set it to directly pos.
-    `Tail -> Set the current reading position to subtract pos to the tail of channel chan.
-
-    Note: You must set negative value to pos if `Tail selected.
-
-    @param in_channel the input channel to set the current reading position to pos for.
-    @param from the method to detect start position for setting the current reading position.
-    @param pos the position to set the current reading position to.
-*)
-val seek : in_channel -> from:[< `Current | `Head | `Tail]
-  -> pos:int -> unit
-
-(** Read exactly len charactors from the current reading position of the channel chan,
-    and rewind the channel chan to head of it.
-
-    @param chan input channel to read charactors
-    @param len reading length from input channel
-    @return readed charactors
-*)
-val ahead : in_channel -> int -> string option
+(** Implements functions for input channel as extended Pervasive's.
+    Provided functions are able to split some categories, such as
+    binary, text, and useful input funcitons.
+
+    @author derui
+    @version 0.2
+*)
+
+(** Read exactly len charactors from current position of the input channel.
+    If in_channel reached end of file, return None.
+
+    @param chan input channel to read charactors
+    @param len reading length from input channel
+    @return readed charactors
+*)
+val read : chan:in_channel -> len:int -> string option
+
+(** This sets the current reading position to pos for channel chan.
+    You can select some methods to detect setting the current reading position as follows:
+    `Current -> Set the current reading position to add pos to the current reading position.
+    `Head -> Set the current reading position to set it to directly pos.
+    `Tail -> Set the current reading position to subtract pos to the tail of channel chan.
+
+    Note: You must set negative value to pos if `Tail selected.
+
+    @param in_channel the input channel to set the current reading position to pos for.
+    @param from the method to detect start position for setting the current reading position.
+    @param pos the position to set the current reading position to.
+*)
+val seek : in_channel -> from:[< `Current | `Head | `Tail]
+  -> pos:int -> unit
+
+(** Read exactly len charactors from the current reading position of the channel chan,
+    and rewind the channel chan to head of it.
+
+    @param chan input channel to read charactors
+    @param len reading length from input channel
+    @return readed charactors
+*)
+val ahead : in_channel -> int -> string option
diff --git a/lib/baselib/build/math.mli b/lib/baselib/build/math.mli
index 6c6c817..ba48c72 100644
--- a/lib/baselib/build/math.mli
+++ b/lib/baselib/build/math.mli
@@ -1,8 +1,8 @@
-
-(** constant value of pi. *)
-val pi : float
-
-(** conversion radian and degree. *)
-val rad_to_deg : float -> float
-(** see `rad_to_deg` *)
-val deg_to_rad : float -> float
+
+(** constant value of pi. *)
+val pi : float
+
+(** conversion radian and degree. *)
+val rad_to_deg : float -> float
+(** see `rad_to_deg` *)
+val deg_to_rad : float -> float
diff --git a/lib/baselib/build/monad.mli b/lib/baselib/build/monad.mli
index f8eba10..67df629 100644
--- a/lib/baselib/build/monad.mli
+++ b/lib/baselib/build/monad.mli
@@ -1,12 +1,12 @@
-open Monad_intf
-
-(**
-   Make module-specific module of T with module-specific module
-   implemented of Type.
-
-   If you need binary operator to use without module-prefix, call
-   X.Open. (X is your module maked by this functor)
-   X.Open extract only binary operators. other functions are not extracted.
-*)
-module Make (A : Type) : S with type 'a t := 'a A.t
-module Make2 (A : Type2) : S2 with type ('a, 'z) t := ('a, 'z) A.t
+open Monad_intf
+
+(**
+   Make module-specific module of T with module-specific module
+   implemented of Type.
+
+   If you need binary operator to use without module-prefix, call
+   X.Open. (X is your module maked by this functor)
+   X.Open extract only binary operators. other functions are not extracted.
+*)
+module Make (A : Type) : S with type 'a t := 'a A.t
+module Make2 (A : Type2) : S2 with type ('a, 'z) t := ('a, 'z) A.t
diff --git a/lib/baselib/build/option.mli b/lib/baselib/build/option.mli
index 97dc882..5f268ba 100644
--- a/lib/baselib/build/option.mli
+++ b/lib/baselib/build/option.mli
@@ -1,65 +1,65 @@
-(**
-   Add some functions for predefined {!option}.
-   this module provide below modules for 'a option.
-
-   - Monad
-   - TypedCollection
-
-   Use Make functor if you need type-specific option.
-   But, have remaks of specifiied module made by Make,
-   it can't use as Monad, so if need monadic Option, you use no
-   specified option, that is this module, which is solo access.
-*)
-
-(** Convert Option to string with translating function. *)
-val to_string : ('a -> string) -> 'a option -> string
-
-(** output string that converted option. *)
-val print : Format.formatter -> ('a -> string) -> 'a option -> unit
-
-(** return true if given option is None. *)
-val is_none : 'a option -> bool
-
-(** return true if given option is Some and some value. *)
-val is_some : 'a option -> bool
-
-(** Compared to between two options with comparator for
-    between type variant of type.
-
-    Comparing resulted by this function are as follows:
-
-    | fst  | snd    | result
-    | -----+--------+--------
-    | None | None   |   0
-    | Some | None   |   1
-    | None | Some   |  -1
-    | Some | Some   | depend on comparator
-
-    comparator result are expected to equal {!Pervasive.compare}.
-    @param comparator compared to between any type value. default is {!Pervasive.compare}
-    @param first A option value
-    @param second A option value
-    @return -1 is lesser than, 1 is greater than, to equal 1
-*)
-val compare_with : ?comparator:('a -> 'a -> int) -> 'a option -> 'a option -> int
-
-(** this function applies given function to each element of list,
-    and builds the list with the results returned by given function.
-    But, appling given function only target Some variant. None is ignored.
-*)
-val map : ('a -> 'b) -> 'a option list -> 'b list
-
-(**
-   Provide monadic operation with 'a option.
-
-   Monadic option behaved under {!Monad.Type} functions are following:
-
-   | return : Wraping given argument to Some.
-   | bind   : If given monad is None, chain of bindings finish on the
-   |          spot, and return None.
-   |          Otherwise it apply function and return result of
-   |          function wrapped Some
-*)
-include Monad_intf.S with type 'a t := 'a option
-include TypedCollection.Type with type 'a t := 'a option
-include TypedCollection.S with type 'a t := 'a option
+(**
+   Add some functions for predefined {!option}.
+   this module provide below modules for 'a option.
+
+   - Monad
+   - TypedCollection
+
+   Use Make functor if you need type-specific option.
+   But, have remaks of specifiied module made by Make,
+   it can't use as Monad, so if need monadic Option, you use no
+   specified option, that is this module, which is solo access.
+*)
+
+(** Convert Option to string with translating function. *)
+val to_string : ('a -> string) -> 'a option -> string
+
+(** output string that converted option. *)
+val print : Format.formatter -> ('a -> string) -> 'a option -> unit
+
+(** return true if given option is None. *)
+val is_none : 'a option -> bool
+
+(** return true if given option is Some and some value. *)
+val is_some : 'a option -> bool
+
+(** Compared to between two options with comparator for
+    between type variant of type.
+
+    Comparing resulted by this function are as follows:
+
+    | fst  | snd    | result
+    | -----+--------+--------
+    | None | None   |   0
+    | Some | None   |   1
+    | None | Some   |  -1
+    | Some | Some   | depend on comparator
+
+    comparator result are expected to equal {!Pervasive.compare}.
+    @param comparator compared to between any type value. default is {!Pervasive.compare}
+    @param first A option value
+    @param second A option value
+    @return -1 is lesser than, 1 is greater than, to equal 1
+*)
+val compare_with : ?comparator:('a -> 'a -> int) -> 'a option -> 'a option -> int
+
+(** this function applies given function to each element of list,
+    and builds the list with the results returned by given function.
+    But, appling given function only target Some variant. None is ignored.
+*)
+val map : ('a -> 'b) -> 'a option list -> 'b list
+
+(**
+   Provide monadic operation with 'a option.
+
+   Monadic option behaved under {!Monad.Type} functions are following:
+
+   | return : Wraping given argument to Some.
+   | bind   : If given monad is None, chain of bindings finish on the
+   |          spot, and return None.
+   |          Otherwise it apply function and return result of
+   |          function wrapped Some
+*)
+include Monad_intf.S with type 'a t := 'a option
+include TypedCollection.Type with type 'a t := 'a option
+include TypedCollection.S with type 'a t := 'a option
diff --git a/lib/baselib/build/prelude.mli b/lib/baselib/build/prelude.mli
index 38380c8..b8e4cf8 100644
--- a/lib/baselib/build/prelude.mli
+++ b/lib/baselib/build/prelude.mli
@@ -1,41 +1,41 @@
-(**
-   The Prelude module.
-
-   Some useful and basically functions contained this module.
-   All functions doesn't belong any module, are used to some situation
-   as utility.
-*)
-
-(** identity function *)
-val id : 'a -> 'a
-(** constant function. always return first argument. *)
-val const : 'a -> 'b -> 'a
-(** flip argument align. *)
-val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
-
-(** control direction of to apply function to argument.
-   |> looks like monad bind (>>=) is reversed to apply argument of
-   normal direction.
-*)
-val (|>) : 'a -> ('a -> 'b ) -> 'b
-
-(** control direction of to apply function to argument.
-   |< is alias of normal function application.
-*)
-val (|<) : ('a -> 'b) -> 'a -> 'b
-
-(** Combine two functions like from haskell's *)
-val (@<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
-(** Combine two functions which direction to apply is forward *)
-val (@>) : ('a -> 'b)  -> ('b -> 'c) -> 'a -> 'c
-
-
-(** comparing floats that if one float has difference lesser than
-  `epsilon`, result of comparing is `0` as true.
-*)
-val cmp_float : epsilon:float -> float -> float -> int
-
-(** curry converts an uncurried function to a curried function *)
-val curry: ('a * 'b -> 'c) -> 'a -> 'b -> 'c
-(** convertes an curried function to an uncirried function *)
-val uncurry: ('a -> 'b -> 'c) -> 'a * 'b -> 'c
+(**
+   The Prelude module.
+
+   Some useful and basically functions contained this module.
+   All functions doesn't belong any module, are used to some situation
+   as utility.
+*)
+
+(** identity function *)
+val id : 'a -> 'a
+(** constant function. always return first argument. *)
+val const : 'a -> 'b -> 'a
+(** flip argument align. *)
+val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
+
+(** control direction of to apply function to argument.
+   |> looks like monad bind (>>=) is reversed to apply argument of
+   normal direction.
+*)
+val (|>) : 'a -> ('a -> 'b ) -> 'b
+
+(** control direction of to apply function to argument.
+   |< is alias of normal function application.
+*)
+val (|<) : ('a -> 'b) -> 'a -> 'b
+
+(** Combine two functions like from haskell's *)
+val (@<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
+(** Combine two functions which direction to apply is forward *)
+val (@>) : ('a -> 'b)  -> ('b -> 'c) -> 'a -> 'c
+
+
+(** comparing floats that if one float has difference lesser than
+  `epsilon`, result of comparing is `0` as true.
+*)
+val cmp_float : epsilon:float -> float -> float -> int
+
+(** curry converts an uncurried function to a curried function *)
+val curry: ('a * 'b -> 'c) -> 'a -> 'b -> 'c
+(** convertes an curried function to an uncirried function *)
+val uncurry: ('a -> 'b -> 'c) -> 'a * 'b -> 'c
diff --git a/lib/baselib/build/stringable.mli b/lib/baselib/build/stringable.mli
index a7a27c4..bd0aad2 100644
--- a/lib/baselib/build/stringable.mli
+++ b/lib/baselib/build/stringable.mli
@@ -1,22 +1,22 @@
-(* Stringable Type. *)
-module type Type =
-sig
-  type t
-  (* translate t into string. *)
-  val to_string : t -> string
-end
-
-(* Signature of Stringable. *)
-module type S =
-sig
-  type t
-  (* printing type with Format.fomatter. *)
-  val print : Format.formatter -> t -> unit
-  (* type convert to character array. *)
-  val to_chararray : t -> char array
-  (* type conver to character list. *)
-  val to_charlist : t -> char list
-end
-
-(* Functor to make new Stringable module. *)
-module Make (T : Type) : S with type t := T.t
+(* Stringable Type. *)
+module type Type =
+sig
+  type t
+  (* translate t into string. *)
+  val to_string : t -> string
+end
+
+(* Signature of Stringable. *)
+module type S =
+sig
+  type t
+  (* printing type with Format.fomatter. *)
+  val print : Format.formatter -> t -> unit
+  (* type convert to character array. *)
+  val to_chararray : t -> char array
+  (* type conver to character list. *)
+  val to_charlist : t -> char list
+end
+
+(* Functor to make new Stringable module. *)
+module Make (T : Type) : S with type t := T.t
diff --git a/lib/baselib/build/typedCollection.mli b/lib/baselib/build/typedCollection.mli
index 9b55969..6a6c663 100644
--- a/lib/baselib/build/typedCollection.mli
+++ b/lib/baselib/build/typedCollection.mli
@@ -1,28 +1,28 @@
-module type Type =
-sig
-  type 'a t
-  val empty : 'a t
-  (* add element for elt to t *)
-  val add : 'a -> 'a t -> 'a t
-  (* apply each element of t with first element is 'a *)
-  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-end
-
-module type S =
-sig
-  type 'a t
-  (* folding with index of element in t *)
-  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-  (* execute affects with index of element of t *)
-  val iteri : (int -> 'a -> unit) -> 'a t -> unit
-  (* append element to t if arg is Some. *)
-  val add_option : 'a option -> 'a t -> 'a t
-  (* convert t from list. *)
-  val of_list : 'a list -> 'a t
-  (* convert list from t *)
-  val to_list : 'a t -> 'a list
-  (* add all element of list to given t. *)
-  val add_list : 'a list -> 'a t -> 'a t
-end
-
-module Make (T:Type) : S with type 'a t := 'a T.t
+module type Type =
+sig
+  type 'a t
+  val empty : 'a t
+  (* add element for elt to t *)
+  val add : 'a -> 'a t -> 'a t
+  (* apply each element of t with first element is 'a *)
+  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+end
+
+module type S =
+sig
+  type 'a t
+  (* folding with index of element in t *)
+  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+  (* execute affects with index of element of t *)
+  val iteri : (int -> 'a -> unit) -> 'a t -> unit
+  (* append element to t if arg is Some. *)
+  val add_option : 'a option -> 'a t -> 'a t
+  (* convert t from list. *)
+  val of_list : 'a list -> 'a t
+  (* convert list from t *)
+  val to_list : 'a t -> 'a list
+  (* add all element of list to given t. *)
+  val add_list : 'a list -> 'a t -> 'a t
+end
+
+module Make (T:Type) : S with type 'a t := 'a T.t
diff --git a/lib/baselib/build/typedComparable.mli b/lib/baselib/build/typedComparable.mli
index a6aac21..84e8a84 100644
--- a/lib/baselib/build/typedComparable.mli
+++ b/lib/baselib/build/typedComparable.mli
@@ -1,35 +1,35 @@
-
-(* this module is used to functor when needs some modules to compare t
-   with type variable.  *)
-module type Type =
-sig
-  type 'a t
-  (* compare elements. if first @t@ is less than second, return -1.
-     if first @t@ equal second, return 0.
-     return 1 if first @t@ is greater than second.
-  *)
-  val compare : 'a t -> 'a t -> int
-end
-
-module type S =
-sig
-  (* element type of this signature. this is had to overwrite when
-     using any module. *)
-  type 'a t
-
-  (* equals *)
-  val eq : 'a t -> 'a t -> bool
-  (* no'a t equals *)
-  val ne : 'a t -> 'a t -> bool
-  (* greater than *)
-  val gt : 'a t -> 'a t -> bool
-  (* greater equal *)
-  val ge : 'a t -> 'a t -> bool
-  (* less than *)
-  val lt : 'a t -> 'a t -> bool
-  (* less equal *)
-  val le : 'a t -> 'a t -> bool
-end
-
-(* using this module when need order functions. *)
-module Make (T : Type) : S with type 'a t := 'a T.t
+
+(* this module is used to functor when needs some modules to compare t
+   with type variable.  *)
+module type Type =
+sig
+  type 'a t
+  (* compare elements. if first @t@ is less than second, return -1.
+     if first @t@ equal second, return 0.
+     return 1 if first @t@ is greater than second.
+  *)
+  val compare : 'a t -> 'a t -> int
+end
+
+module type S =
+sig
+  (* element type of this signature. this is had to overwrite when
+     using any module. *)
+  type 'a t
+
+  (* equals *)
+  val eq : 'a t -> 'a t -> bool
+  (* no'a t equals *)
+  val ne : 'a t -> 'a t -> bool
+  (* greater than *)
+  val gt : 'a t -> 'a t -> bool
+  (* greater equal *)
+  val ge : 'a t -> 'a t -> bool
+  (* less than *)
+  val lt : 'a t -> 'a t -> bool
+  (* less equal *)
+  val le : 'a t -> 'a t -> bool
+end
+
+(* using this module when need order functions. *)
+module Make (T : Type) : S with type 'a t := 'a T.t
diff --git a/lib/baselib/build/typedStringable.mli b/lib/baselib/build/typedStringable.mli
index bd40d77..b94dcd6 100644
--- a/lib/baselib/build/typedStringable.mli
+++ b/lib/baselib/build/typedStringable.mli
@@ -1,22 +1,22 @@
-(* Stringable Type. *)
-module type Type =
-sig
-  type 'a t
-  (* translate t into string. *)
-  val to_string : 'a t -> string
-end
-
-(* Signature of Stringable. *)
-module type S =
-sig
-  type 'a t
-  (* printing type with Format.fomatter. *)
-  val print : Format.formatter -> 'a t -> unit
-  (* type convert to character array. *)
-  val to_chararray : 'a t -> char array
-  (* type conver to character list. *)
-  val to_charlist : 'a t -> char list
-end
-
-(* Functor to make new Stringable module. *)
-module Make (T : Type) : S with type 'a t := 'a T.t
+(* Stringable Type. *)
+module type Type =
+sig
+  type 'a t
+  (* translate t into string. *)
+  val to_string : 'a t -> string
+end
+
+(* Signature of Stringable. *)
+module type S =
+sig
+  type 'a t
+  (* printing type with Format.fomatter. *)
+  val print : Format.formatter -> 'a t -> unit
+  (* type convert to character array. *)
+  val to_chararray : 'a t -> char array
+  (* type conver to character list. *)
+  val to_charlist : 'a t -> char list
+end
+
+(* Functor to make new Stringable module. *)
+module Make (T : Type) : S with type 'a t := 'a T.t
diff --git a/lib/baselib/src/OMakefile b/lib/baselib/src/OMakefile
index 0f1847a..e1a5621 100644
--- a/lib/baselib/src/OMakefile
+++ b/lib/baselib/src/OMakefile
@@ -1,80 +1,80 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-
-################################################
-# Configuration.  You may want to modify any of these configuration
-# variables.
-#
-.PHONY: all lib
-#
-# This project requires ocamlfind (default - false).
-#
-USE_OCAMLFIND = true
-#
-OCAMLPACKS[] =
-     num
-#    pack2
-#
-if $(not $(OCAMLFIND_EXISTS))
-   eprintln(This project requires ocamlfind, but is was not found.)
-   eprintln(You need to install ocamlfind and run "omake --configure".)
-   exit 1
-
-#
-# Include path
-#
-# OCAMLINCLUDES += /usr/lib/ocaml
-
-#
-# Compile native or byte code?
-#
-# The default values are defined as follows:
-#
-NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-#
-# Various options
-#
-OCAMLFLAGS    += -annot -bin-annot
-# OCAMLCFLAGS   +=
-# OCAMLOPTFLAGS +=
-# OCAML_LINK_FLAGS +=
-# OCAML_BYTE_LINK_FLAGS +=
-# OCAML_NATIVE_LINK_FLAGS +=
-
-################################################
-# Build an OCaml library
-#
-FILES[] = $(removesuffix $(ls *ml))
-#
-LIB = baselib
-#
-INSTALL_FILES = $(OCamlPackageGeneratedFiles $(LIB), false)
-INSTALL_FILES += $(ls *mli)
-
-MyOCamlPackage($(LIB), $(FILES), $(EMPTY), $(EMPTY), false)
-OCamlInstallParentPackage(sdlcaml, $(INSTALL_FILES))
-
-lib: $(OCamlPackageGeneratedFiles $(LIB), false)
-
-all: lib
-
-.DEFAULT: all
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+.PHONY: all lib
+#
+# This project requires ocamlfind (default - false).
+#
+USE_OCAMLFIND = true
+#
+OCAMLPACKS[] =
+     num
+#    pack2
+#
+if $(not $(OCAMLFIND_EXISTS))
+   eprintln(This project requires ocamlfind, but is was not found.)
+   eprintln(You need to install ocamlfind and run "omake --configure".)
+   exit 1
+
+#
+# Include path
+#
+# OCAMLINCLUDES += /usr/lib/ocaml
+
+#
+# Compile native or byte code?
+#
+# The default values are defined as follows:
+#
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = true
+
+#
+# Various options
+#
+OCAMLFLAGS    += -annot -bin-annot
+# OCAMLCFLAGS   +=
+# OCAMLOPTFLAGS +=
+# OCAML_LINK_FLAGS +=
+# OCAML_BYTE_LINK_FLAGS +=
+# OCAML_NATIVE_LINK_FLAGS +=
+
+################################################
+# Build an OCaml library
+#
+FILES[] = $(removesuffix $(ls *ml))
+#
+LIB = baselib
+#
+INSTALL_FILES = $(OCamlPackageGeneratedFiles $(LIB), false)
+INSTALL_FILES += $(ls *mli)
+
+MyOCamlPackage($(LIB), $(FILES), $(EMPTY), $(EMPTY), false)
+OCamlInstallParentPackage(sdlcaml, $(INSTALL_FILES))
+
+lib: $(OCamlPackageGeneratedFiles $(LIB), false)
+
+all: lib
+
+.DEFAULT: all
diff --git a/lib/baselib/src/binary_pack.ml b/lib/baselib/src/binary_pack.ml
index a73f005..cd7cca8 100644
--- a/lib/baselib/src/binary_pack.ml
+++ b/lib/baselib/src/binary_pack.ml
@@ -1,210 +1,210 @@
-open Prelude
-
-(* endianness of binary data *)
-type endian = Little_endian | Big_endian
-
-exception Binary_pack_invalid_offset of string
-exception Binary_pack_invalid_byte_range of int
-exception Binary_pack_invalid_short_range of int
-exception Binary_pack_invalid_unsigned_short_range of int
-exception Binary_pack_invalid_int_position of int
-exception Binary_pack_invalid_int64_position of int
-exception Binary_pack_invalid_float_position of int
-exception Binary_pack_invalid_buffer_position of int
-
-
-module type BinaryArray = sig
-  type t
-  val length: t -> int
-  val get: t -> int -> char
-  val set: t -> int -> char -> unit
-end
-
-module type S = sig
-  type t
-
-  val unpack_unsigned_8 : buffer:t -> pos:int -> int
-  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
-  val unpack_signed_8 : buffer:t -> pos:int -> int
-  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
-  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
-  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
-  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
-  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
-  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
-  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
-  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
-  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
-  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
-  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-
-end
-
-(** The functor make functions for given binary array. *)
-module Make(A:BinaryArray) = struct
-
-  type t = A.t
-
-  (* helper function to calculate byte offset from byte order *)
-  let offset ~byte_order  ~len pos =
-    if len < pos || pos < 0 then
-      raise (Binary_pack_invalid_offset "can not calculate a offset of byte")
-    else
-      match byte_order with
-      | Little_endian -> len - pos - 1
-      | Big_endian -> pos
-
-  let unpack_unsigned_8 ~buffer ~pos =
-    assert(A.length buffer >= pos);
-    Char.code (A.get buffer pos)
-
-  let pack_unsigned_8 ~buffer ~pos value =
-    assert(A.length buffer >= pos);
-    if value > 0xff || value < 0 then
-      raise (Binary_pack_invalid_byte_range value)
-    else
-      A.set buffer pos |< Char.chr value
-
-  let unpack_signed_8 ~buffer ~pos =
-    assert(A.length buffer >= pos);
-    let ch = Char.code |< A.get buffer pos in
-    if ch >= 0x80 then -(0x100 - ch) else ch
-
-  let pack_signed_8 ~buffer ~pos value =
-    assert(A.length buffer >= pos);
-    if value >= 0x80 || value <= -0x81 then
-      raise (Binary_pack_invalid_byte_range value)
-    else
-      A.set buffer pos @< Char.chr |< (value land 0xff)
-
-  let unpack_signed_16 ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 1);
-    let n = (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 0)) lsl 8) lor
-      (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 1))) in
-    if n >= 0x8000 then -(0x10000 - n) else n
-
-  let pack_signed_16 ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 1);
-    if n > 0x7fff || n < -0x8000 then
-      raise (Binary_pack_invalid_short_range n)
-    else begin
-      (A.set buffer (pos + offset ~byte_order ~len:2 0) @< Char.chr) |< n lsr 8 land 0xff;
-      (A.set buffer (pos + offset ~byte_order ~len:2 1) @< Char.chr) |< n land 0xff;
-    end
-
-  exception Binary_pack_invalid_unsigned_short_range of int
-  let unpack_unsigned_16 ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 1);
-    (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 0)) lsl 8) lor
-      (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 1)))
-
-  let pack_unsigned_16 ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 1);
-    if n > 0xffff || n < 0 then
-      raise (Binary_pack_invalid_unsigned_short_range n)
-    else begin
-      (A.set buffer (pos + offset ~byte_order ~len:2 0) @< Char.chr) |< n lsr 8 land 0xff;
-      (A.set buffer (pos + offset ~byte_order ~len:2 1) @< Char.chr) |< n land 0xff;
-    end
-
-  let unpack_signed_32 ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 3);
-    let n0 = Int32.of_int (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 0)) in
-    let n1 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 1)) lsl 16 in
-    let n2 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 2)) lsl 8 in
-    let n3 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 3)) in
-    Int32.logor (Int32.shift_left n0 24) (Int32.of_int (n1 lor n2 lor n3))
-
-  let unpack_signed_32_int ~byte_order ~buffer ~pos =
-    assert(Sys.word_size = 32);
-    assert(A.length buffer >= pos + 3);
-    let n0 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 0)) lsl 24 in
-    let n1 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 1)) lsl 16 in
-    let n2 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 2)) lsl 8 in
-    let n3 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 3)) in
-    n0 lor n1 lor n2 lor n3
-
-  let pack_signed_32 ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 3);
-    let mask = Int32.of_int 0xff in
-    let n0 = Int32.to_int (Int32.logand mask (Int32.shift_right n 24))
-    and n1 = Int32.to_int (Int32.logand mask (Int32.shift_right n 16))
-    and n2 = Int32.to_int (Int32.logand mask (Int32.shift_right n 8))
-    and n3 = Int32.to_int (Int32.logand mask n) in
-    (A.set buffer (pos + offset ~byte_order ~len:4 0) @< Char.chr) n0;
-    (A.set buffer (pos + offset ~byte_order ~len:4 1) @< Char.chr) n1;
-    (A.set buffer (pos + offset ~byte_order ~len:4 2) @< Char.chr) n2;
-    (A.set buffer (pos + offset ~byte_order ~len:4 3) @< Char.chr) n3
-
-  let pack_signed_32_int ~byte_order ~buffer ~pos n =
-    assert(Sys.word_size = 32);
-    assert(A.length buffer >= pos + 3);
-    A.set buffer (pos + offset ~byte_order ~len:4 0) |< Char.chr (n lsr 24 land 0xff);
-    A.set buffer (pos + offset ~byte_order ~len:4 1) |< Char.chr (n lsr 16 land 0xff);
-    A.set buffer (pos + offset ~byte_order ~len:4 2) |< Char.chr (n lsr 8 land 0xff);
-    A.set buffer (pos + offset ~byte_order ~len:4 3) |< Char.chr (n land 0xff)
-
-  let unpack_signed_64 ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 7);
-    let n0 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 0)
-    and n1 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 1)
-    and n2 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 2)
-    and n3 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 3)
-    and n4 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 4)
-    and n5 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 5)
-    and n6 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 6)
-    and n7 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 7) in
-    (Int64.logor (Int64.shift_left n0 56)
-     @< Int64.logor (Int64.shift_left n1 48)
-     @< Int64.logor (Int64.shift_left n2 40)
-     @< Int64.logor (Int64.shift_left n3 32)
-     @< Int64.logor (Int64.shift_left n4 24)
-     @< Int64.logor (Int64.shift_left n5 16)
-     @< Int64.logor (Int64.shift_left n6 8)) (Int64.shift_left n7 0)
-
-  let pack_signed_64 ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 7);
-    let mask = Int64.of_int 0xff in
-    let masked len = Int64.logand mask (Int64.shift_right n len) in
-    (A.set buffer (pos + offset ~byte_order ~len:8 0) @< Char.chr) |< Int64.to_int (masked 56);
-    (A.set buffer (pos + offset ~byte_order ~len:8 1) @< Char.chr) |< Int64.to_int (masked 48);
-    (A.set buffer (pos + offset ~byte_order ~len:8 2) @< Char.chr) |< Int64.to_int (masked 40);
-    (A.set buffer (pos + offset ~byte_order ~len:8 3) @< Char.chr) |< Int64.to_int (masked 32);
-    (A.set buffer (pos + offset ~byte_order ~len:8 4) @< Char.chr) |< Int64.to_int (masked 24);
-    (A.set buffer (pos + offset ~byte_order ~len:8 5) @< Char.chr) |< Int64.to_int (masked 16);
-    (A.set buffer (pos + offset ~byte_order ~len:8 6) @< Char.chr) |< Int64.to_int (masked  8);
-    (A.set buffer (pos + offset ~byte_order ~len:8 7) @< Char.chr) |< Int64.to_int (masked  0)
-
-  let unpack_float ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 7);
-    let n = unpack_signed_64 ~byte_order ~buffer ~pos in
-    Int64.float_of_bits n
-
-  let pack_float ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 7 );
-    let bits = Int64.bits_of_float n in
-    pack_signed_64 ~byte_order ~buffer ~pos bits
-
-  let unpack_float_c ~byte_order ~buffer ~pos =
-    assert(A.length buffer >= pos + 3);
-    let n = unpack_signed_32 ~byte_order ~buffer ~pos in
-    Int32.float_of_bits n
-
-  let pack_float_c ~byte_order ~buffer ~pos n =
-    assert(A.length buffer >= pos + 3);
-    let bits = Int32.bits_of_float n in
-    pack_signed_32 ~byte_order ~buffer ~pos bits
-
-end
-
-include Make(struct
-  type t = string
-  let get buf pos = buf.[pos]
-  let set buf pos ch = buf.[pos] <- ch
-  let length = String.length
-end
-)
+open Prelude
+
+(* endianness of binary data *)
+type endian = Little_endian | Big_endian
+
+exception Binary_pack_invalid_offset of string
+exception Binary_pack_invalid_byte_range of int
+exception Binary_pack_invalid_short_range of int
+exception Binary_pack_invalid_unsigned_short_range of int
+exception Binary_pack_invalid_int_position of int
+exception Binary_pack_invalid_int64_position of int
+exception Binary_pack_invalid_float_position of int
+exception Binary_pack_invalid_buffer_position of int
+
+
+module type BinaryArray = sig
+  type t
+  val length: t -> int
+  val get: t -> int -> char
+  val set: t -> int -> char -> unit
+end
+
+module type S = sig
+  type t
+
+  val unpack_unsigned_8 : buffer:t -> pos:int -> int
+  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
+  val unpack_signed_8 : buffer:t -> pos:int -> int
+  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
+  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
+  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
+  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
+  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
+  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
+  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
+  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
+  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
+  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
+  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+
+end
+
+(** The functor make functions for given binary array. *)
+module Make(A:BinaryArray) = struct
+
+  type t = A.t
+
+  (* helper function to calculate byte offset from byte order *)
+  let offset ~byte_order  ~len pos =
+    if len < pos || pos < 0 then
+      raise (Binary_pack_invalid_offset "can not calculate a offset of byte")
+    else
+      match byte_order with
+      | Little_endian -> len - pos - 1
+      | Big_endian -> pos
+
+  let unpack_unsigned_8 ~buffer ~pos =
+    assert(A.length buffer >= pos);
+    Char.code (A.get buffer pos)
+
+  let pack_unsigned_8 ~buffer ~pos value =
+    assert(A.length buffer >= pos);
+    if value > 0xff || value < 0 then
+      raise (Binary_pack_invalid_byte_range value)
+    else
+      A.set buffer pos |< Char.chr value
+
+  let unpack_signed_8 ~buffer ~pos =
+    assert(A.length buffer >= pos);
+    let ch = Char.code |< A.get buffer pos in
+    if ch >= 0x80 then -(0x100 - ch) else ch
+
+  let pack_signed_8 ~buffer ~pos value =
+    assert(A.length buffer >= pos);
+    if value >= 0x80 || value <= -0x81 then
+      raise (Binary_pack_invalid_byte_range value)
+    else
+      A.set buffer pos @< Char.chr |< (value land 0xff)
+
+  let unpack_signed_16 ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 1);
+    let n = (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 0)) lsl 8) lor
+      (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 1))) in
+    if n >= 0x8000 then -(0x10000 - n) else n
+
+  let pack_signed_16 ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 1);
+    if n > 0x7fff || n < -0x8000 then
+      raise (Binary_pack_invalid_short_range n)
+    else begin
+      (A.set buffer (pos + offset ~byte_order ~len:2 0) @< Char.chr) |< n lsr 8 land 0xff;
+      (A.set buffer (pos + offset ~byte_order ~len:2 1) @< Char.chr) |< n land 0xff;
+    end
+
+  exception Binary_pack_invalid_unsigned_short_range of int
+  let unpack_unsigned_16 ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 1);
+    (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 0)) lsl 8) lor
+      (Char.code (A.get buffer (pos + offset ~byte_order ~len:2 1)))
+
+  let pack_unsigned_16 ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 1);
+    if n > 0xffff || n < 0 then
+      raise (Binary_pack_invalid_unsigned_short_range n)
+    else begin
+      (A.set buffer (pos + offset ~byte_order ~len:2 0) @< Char.chr) |< n lsr 8 land 0xff;
+      (A.set buffer (pos + offset ~byte_order ~len:2 1) @< Char.chr) |< n land 0xff;
+    end
+
+  let unpack_signed_32 ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 3);
+    let n0 = Int32.of_int (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 0)) in
+    let n1 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 1)) lsl 16 in
+    let n2 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 2)) lsl 8 in
+    let n3 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 3)) in
+    Int32.logor (Int32.shift_left n0 24) (Int32.of_int (n1 lor n2 lor n3))
+
+  let unpack_signed_32_int ~byte_order ~buffer ~pos =
+    assert(Sys.word_size = 32);
+    assert(A.length buffer >= pos + 3);
+    let n0 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 0)) lsl 24 in
+    let n1 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 1)) lsl 16 in
+    let n2 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 2)) lsl 8 in
+    let n3 = (Char.code |< A.get buffer (pos + offset ~byte_order ~len:4 3)) in
+    n0 lor n1 lor n2 lor n3
+
+  let pack_signed_32 ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 3);
+    let mask = Int32.of_int 0xff in
+    let n0 = Int32.to_int (Int32.logand mask (Int32.shift_right n 24))
+    and n1 = Int32.to_int (Int32.logand mask (Int32.shift_right n 16))
+    and n2 = Int32.to_int (Int32.logand mask (Int32.shift_right n 8))
+    and n3 = Int32.to_int (Int32.logand mask n) in
+    (A.set buffer (pos + offset ~byte_order ~len:4 0) @< Char.chr) n0;
+    (A.set buffer (pos + offset ~byte_order ~len:4 1) @< Char.chr) n1;
+    (A.set buffer (pos + offset ~byte_order ~len:4 2) @< Char.chr) n2;
+    (A.set buffer (pos + offset ~byte_order ~len:4 3) @< Char.chr) n3
+
+  let pack_signed_32_int ~byte_order ~buffer ~pos n =
+    assert(Sys.word_size = 32);
+    assert(A.length buffer >= pos + 3);
+    A.set buffer (pos + offset ~byte_order ~len:4 0) |< Char.chr (n lsr 24 land 0xff);
+    A.set buffer (pos + offset ~byte_order ~len:4 1) |< Char.chr (n lsr 16 land 0xff);
+    A.set buffer (pos + offset ~byte_order ~len:4 2) |< Char.chr (n lsr 8 land 0xff);
+    A.set buffer (pos + offset ~byte_order ~len:4 3) |< Char.chr (n land 0xff)
+
+  let unpack_signed_64 ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 7);
+    let n0 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 0)
+    and n1 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 1)
+    and n2 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 2)
+    and n3 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 3)
+    and n4 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 4)
+    and n5 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 5)
+    and n6 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 6)
+    and n7 = Int64.of_int @< Char.code |< A.get buffer (pos + offset ~byte_order ~len:8 7) in
+    (Int64.logor (Int64.shift_left n0 56)
+     @< Int64.logor (Int64.shift_left n1 48)
+     @< Int64.logor (Int64.shift_left n2 40)
+     @< Int64.logor (Int64.shift_left n3 32)
+     @< Int64.logor (Int64.shift_left n4 24)
+     @< Int64.logor (Int64.shift_left n5 16)
+     @< Int64.logor (Int64.shift_left n6 8)) (Int64.shift_left n7 0)
+
+  let pack_signed_64 ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 7);
+    let mask = Int64.of_int 0xff in
+    let masked len = Int64.logand mask (Int64.shift_right n len) in
+    (A.set buffer (pos + offset ~byte_order ~len:8 0) @< Char.chr) |< Int64.to_int (masked 56);
+    (A.set buffer (pos + offset ~byte_order ~len:8 1) @< Char.chr) |< Int64.to_int (masked 48);
+    (A.set buffer (pos + offset ~byte_order ~len:8 2) @< Char.chr) |< Int64.to_int (masked 40);
+    (A.set buffer (pos + offset ~byte_order ~len:8 3) @< Char.chr) |< Int64.to_int (masked 32);
+    (A.set buffer (pos + offset ~byte_order ~len:8 4) @< Char.chr) |< Int64.to_int (masked 24);
+    (A.set buffer (pos + offset ~byte_order ~len:8 5) @< Char.chr) |< Int64.to_int (masked 16);
+    (A.set buffer (pos + offset ~byte_order ~len:8 6) @< Char.chr) |< Int64.to_int (masked  8);
+    (A.set buffer (pos + offset ~byte_order ~len:8 7) @< Char.chr) |< Int64.to_int (masked  0)
+
+  let unpack_float ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 7);
+    let n = unpack_signed_64 ~byte_order ~buffer ~pos in
+    Int64.float_of_bits n
+
+  let pack_float ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 7 );
+    let bits = Int64.bits_of_float n in
+    pack_signed_64 ~byte_order ~buffer ~pos bits
+
+  let unpack_float_c ~byte_order ~buffer ~pos =
+    assert(A.length buffer >= pos + 3);
+    let n = unpack_signed_32 ~byte_order ~buffer ~pos in
+    Int32.float_of_bits n
+
+  let pack_float_c ~byte_order ~buffer ~pos n =
+    assert(A.length buffer >= pos + 3);
+    let bits = Int32.bits_of_float n in
+    pack_signed_32 ~byte_order ~buffer ~pos bits
+
+end
+
+include Make(struct
+  type t = string
+  let get buf pos = buf.[pos]
+  let set buf pos ch = buf.[pos] <- ch
+  let length = String.length
+end
+)
diff --git a/lib/baselib/src/binary_pack.mli b/lib/baselib/src/binary_pack.mli
index e2ce6e9..deda6fc 100644
--- a/lib/baselib/src/binary_pack.mli
+++ b/lib/baselib/src/binary_pack.mli
@@ -1,211 +1,211 @@
-(** Utility functions for conversion binary data to OCaml data, or OCaml data to binary data.
-    These functions are used with in/out channel and binary readed buffer.
-
-    In addition, this module include conversion function for to convert C-type float (4byte).
-
-    This module privides functions for string to pack and unpack values.
-
-    @author derui
-    @version 0.2
-*)
-
-(** endianness of binary data *)
-type endian = Little_endian | Big_endian
-
-(** Exception for invalid byte position when calculate offset *)
-exception Binary_pack_invalid_byte_range of int
-exception Binary_pack_invalid_short_range of int
-exception Binary_pack_invalid_unsigned_short_range of int
-exception Binary_pack_invalid_int_position of int
-exception Binary_pack_invalid_int64_position of int
-exception Binary_pack_invalid_float_position of int
-
-(** Exception for invalid buffer position to write unpacked value. *)
-exception Binary_pack_invalid_buffer_position of int
-
-
-(** The module is used by argument for Binary_pack functions
-    instead of charactor array that equals string.
-*)
-module type BinaryArray = sig
-  type t
-  val length: t -> int
-  val get: t -> int -> char
-  val set: t -> int -> char -> unit
-end
-
-(** Functions that is used to pack and unpack values.
-*)
-module type S = sig
-  type t
-
-  (** Pack unsigned char data of the buffer at pos to OCaml int.
-      Use a element of the buffer.
-      Limits packed value between 0 to 255.
-
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_byte_position
-  *)
-  val unpack_unsigned_8 : buffer:t -> pos:int -> int
-
-  (** Unpack unsigned char data by given OCaml int, and
-      write unpacked value to the buffer at the pos.
-      Limits unpacked value between 0 to 255.
-      If given value to pack is greater than 255, write 0 to buffer.
-
-      @param buffer the buffer to write unpacked value
-      @param pos the position at the buffer to write unpacked value
-      @param value the value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed char data of the buffer at pos to OCaml int.
-      see {!pack_unsigned_8}
-  *)
-  val unpack_signed_8 : buffer:t -> pos:int -> int
-
-  (** Unpack signed char data of the buffer at pos to OCaml int.
-      see {!pack_unsigned_8}
-  *)
-  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed short data of the buffer at pos to OCaml int.
-      Use two element beginning of the buffer from pos.
-      Limits packed value between 32767 to -32768.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_byte_position
-  *)
-  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
-
-  (** Unpack signed short data from given OCaml int.
-      Write unpacked value to the buffer from the pos
-      Limits packed value between 32767 to -32768.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 0 to 255.
-      @raise Bnary_pack_invalid_short_position
-  *)
-  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** see {!pack_signed_16} *)
-  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
-  (** see {!unpack_signed_16} *)
-  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed integer data of the buffer at pos to int32.
-      Use four element beginning of the buffer from pos.
-      Limits packed value between 2^31-1 to -2^31
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^31-1 to -2^31
-      @raise Bnary_pack_invalid_int_position
-  *)
-  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
-  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
-
-  (** Unpack signed integer data from given int32 or OCaml int, and
-      write unpacked value to the buvver from the pos.
-      Limits packed value between 2^31-1 to -2^31
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the integer value to unpack between 2^31-1 to -2^31
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
-  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
-
-  (** Pack signed 64bit integer data of the buffer at pos to int64.
-      Use four element beginning of the buffer from pos.
-      Limits packed value between 2^63-1 to -2^63
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_int64_position
-  *)
-  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
-
-  (** Unpack signed integer data from given int64, and
-      write unpacked value to the buvver from the pos.
-      Limits packed value between 2^63-1 to -2^63
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the integer value to unpack between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
-
-  (** Pack double precision floating number of the buffer at pos to float.
-      Use eight element beginning of the buffer from pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value between 2^63-1 to -2^63
-      @raise Bnary_pack_invalid_float_position
-  *)
-  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
-
-  (** Unpack double precision floating number from given float, and
-      write unpacked value to the buffer from the pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the floating value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-
-  (** Pack uni precision floating number of the buffer at pos to float.
-      Use four element beginning of the buffer from pos.
-      Limits packed value to ocaml float
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to pack unsigned char.
-      @param pos the position at the buffer to pack.
-      @return packed value
-      @raise Bnary_pack_invalid_float_position
-  *)
-  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
-
-  (** Unpack uni precision floating number from given float, and
-      write unpacked value to the buffer from the pos.
-      Limits packed value to ocaml float.
-
-      Note: This function convert double precision floating number to uni,
-      so unpacked value drop off some precision value from original.
-      Therefore, there is not able to recover dropped off some precision.
-
-      @param endian endianness of the buffer.
-      @param buffer the buffer to write unpacked value.
-      @param pos the position at the buffer to write unpack value.
-      @param integer the floating value to unpack
-      @raise Bnary_pack_invalid_buffer_position
-  *)
-  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
-
-end
-
-(** The functor make functions for given binary array. *)
-module Make(A:BinaryArray) : S with type t = A.t
-
-include S with type t = string
+(** Utility functions for conversion binary data to OCaml data, or OCaml data to binary data.
+    These functions are used with in/out channel and binary readed buffer.
+
+    In addition, this module include conversion function for to convert C-type float (4byte).
+
+    This module privides functions for string to pack and unpack values.
+
+    @author derui
+    @version 0.2
+*)
+
+(** endianness of binary data *)
+type endian = Little_endian | Big_endian
+
+(** Exception for invalid byte position when calculate offset *)
+exception Binary_pack_invalid_byte_range of int
+exception Binary_pack_invalid_short_range of int
+exception Binary_pack_invalid_unsigned_short_range of int
+exception Binary_pack_invalid_int_position of int
+exception Binary_pack_invalid_int64_position of int
+exception Binary_pack_invalid_float_position of int
+
+(** Exception for invalid buffer position to write unpacked value. *)
+exception Binary_pack_invalid_buffer_position of int
+
+
+(** The module is used by argument for Binary_pack functions
+    instead of charactor array that equals string.
+*)
+module type BinaryArray = sig
+  type t
+  val length: t -> int
+  val get: t -> int -> char
+  val set: t -> int -> char -> unit
+end
+
+(** Functions that is used to pack and unpack values.
+*)
+module type S = sig
+  type t
+
+  (** Pack unsigned char data of the buffer at pos to OCaml int.
+      Use a element of the buffer.
+      Limits packed value between 0 to 255.
+
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_byte_position
+  *)
+  val unpack_unsigned_8 : buffer:t -> pos:int -> int
+
+  (** Unpack unsigned char data by given OCaml int, and
+      write unpacked value to the buffer at the pos.
+      Limits unpacked value between 0 to 255.
+      If given value to pack is greater than 255, write 0 to buffer.
+
+      @param buffer the buffer to write unpacked value
+      @param pos the position at the buffer to write unpacked value
+      @param value the value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_unsigned_8 : buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed char data of the buffer at pos to OCaml int.
+      see {!pack_unsigned_8}
+  *)
+  val unpack_signed_8 : buffer:t -> pos:int -> int
+
+  (** Unpack signed char data of the buffer at pos to OCaml int.
+      see {!pack_unsigned_8}
+  *)
+  val pack_signed_8 : buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed short data of the buffer at pos to OCaml int.
+      Use two element beginning of the buffer from pos.
+      Limits packed value between 32767 to -32768.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_byte_position
+  *)
+  val unpack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int
+
+  (** Unpack signed short data from given OCaml int.
+      Write unpacked value to the buffer from the pos
+      Limits packed value between 32767 to -32768.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 0 to 255.
+      @raise Bnary_pack_invalid_short_position
+  *)
+  val pack_signed_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** see {!pack_signed_16} *)
+  val unpack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int
+  (** see {!unpack_signed_16} *)
+  val pack_unsigned_16 : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed integer data of the buffer at pos to int32.
+      Use four element beginning of the buffer from pos.
+      Limits packed value between 2^31-1 to -2^31
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^31-1 to -2^31
+      @raise Bnary_pack_invalid_int_position
+  *)
+  val unpack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32
+  val unpack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int
+
+  (** Unpack signed integer data from given int32 or OCaml int, and
+      write unpacked value to the buvver from the pos.
+      Limits packed value between 2^31-1 to -2^31
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the integer value to unpack between 2^31-1 to -2^31
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_signed_32 : byte_order:endian -> buffer:t -> pos:int -> int32 -> unit
+  val pack_signed_32_int : byte_order:endian -> buffer:t -> pos:int -> int -> unit
+
+  (** Pack signed 64bit integer data of the buffer at pos to int64.
+      Use four element beginning of the buffer from pos.
+      Limits packed value between 2^63-1 to -2^63
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_int64_position
+  *)
+  val unpack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64
+
+  (** Unpack signed integer data from given int64, and
+      write unpacked value to the buvver from the pos.
+      Limits packed value between 2^63-1 to -2^63
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the integer value to unpack between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_signed_64 : byte_order:endian -> buffer:t -> pos:int -> int64 -> unit
+
+  (** Pack double precision floating number of the buffer at pos to float.
+      Use eight element beginning of the buffer from pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value between 2^63-1 to -2^63
+      @raise Bnary_pack_invalid_float_position
+  *)
+  val unpack_float : byte_order:endian -> buffer:t -> pos:int -> float
+
+  (** Unpack double precision floating number from given float, and
+      write unpacked value to the buffer from the pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the floating value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_float : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+
+  (** Pack uni precision floating number of the buffer at pos to float.
+      Use four element beginning of the buffer from pos.
+      Limits packed value to ocaml float
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to pack unsigned char.
+      @param pos the position at the buffer to pack.
+      @return packed value
+      @raise Bnary_pack_invalid_float_position
+  *)
+  val unpack_float_c : byte_order:endian -> buffer:t -> pos:int -> float
+
+  (** Unpack uni precision floating number from given float, and
+      write unpacked value to the buffer from the pos.
+      Limits packed value to ocaml float.
+
+      Note: This function convert double precision floating number to uni,
+      so unpacked value drop off some precision value from original.
+      Therefore, there is not able to recover dropped off some precision.
+
+      @param endian endianness of the buffer.
+      @param buffer the buffer to write unpacked value.
+      @param pos the position at the buffer to write unpack value.
+      @param integer the floating value to unpack
+      @raise Bnary_pack_invalid_buffer_position
+  *)
+  val pack_float_c : byte_order:endian -> buffer:t -> pos:int -> float -> unit
+
+end
+
+(** The functor make functions for given binary array. *)
+module Make(A:BinaryArray) : S with type t = A.t
+
+include S with type t = string
diff --git a/lib/baselib/src/collection.ml b/lib/baselib/src/collection.ml
index eb22447..faeffab 100644
--- a/lib/baselib/src/collection.ml
+++ b/lib/baselib/src/collection.ml
@@ -1,68 +1,68 @@
-
-module type Type =
-sig
-  type t
-  type elt
-  val lparen : string
-  val rparen : string
-  val separator : string
-  val empty : t
-  val add : elt -> t -> t
-  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
-  include Stringable.Type with type t := elt
-end
-
-module type S =
-sig
-  type elt
-  type t
-  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
-  val iteri : (int -> elt -> unit) -> t -> unit
-  val add_option : elt option -> t -> t
-  val of_list : elt list -> t
-  val to_list : t -> elt list
-  val add_list : elt list -> t -> t
-  val to_string_sep : string -> string -> string -> t -> string
-
-  include Stringable.Type with type t := t
-  include Stringable.S with type t := t
-end
-
-module Make (T:Type) : S with type elt := T.elt and type t := T.t =
-struct
-  type t = T.t
-  type elt = T.elt
-  let foldi f =
-    let i = ref (-1) in
-    T.fold (fun e t -> i := !i + 1; f !i e t)
-
-  let iteri f t =
-    foldi (fun i e () -> f i e; ()) t ()
-
-  let add_option = function
-      None -> Prelude.id
-    | Some x -> T.add x
-
-  let of_list l =
-    List.fold_right T.add l T.empty
-
-  let to_list t =
-    List.rev (T.fold (fun x l -> x::l) t [])
-
-  let add_list l t =
-    List.fold_left (Prelude.flip T.add) t l
-
-  let to_string_sep lparen rparen sep t =
-    let adds i e s = s ^ (if i <> 0 then sep else "") ^ (T.to_string e)
-    in
-    let s = foldi adds t "" in
-    lparen ^ s ^ rparen
-
-  let to_string = to_string_sep T.lparen T.rparen T.separator
-
-  include Stringable.Make((struct
-    type t = T.t
-    let to_string = to_string
-  end : Stringable.Type with type t = T.t))
-end
-
+
+module type Type =
+sig
+  type t
+  type elt
+  val lparen : string
+  val rparen : string
+  val separator : string
+  val empty : t
+  val add : elt -> t -> t
+  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
+  include Stringable.Type with type t := elt
+end
+
+module type S =
+sig
+  type elt
+  type t
+  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
+  val iteri : (int -> elt -> unit) -> t -> unit
+  val add_option : elt option -> t -> t
+  val of_list : elt list -> t
+  val to_list : t -> elt list
+  val add_list : elt list -> t -> t
+  val to_string_sep : string -> string -> string -> t -> string
+
+  include Stringable.Type with type t := t
+  include Stringable.S with type t := t
+end
+
+module Make (T:Type) : S with type elt := T.elt and type t := T.t =
+struct
+  type t = T.t
+  type elt = T.elt
+  let foldi f =
+    let i = ref (-1) in
+    T.fold (fun e t -> i := !i + 1; f !i e t)
+
+  let iteri f t =
+    foldi (fun i e () -> f i e; ()) t ()
+
+  let add_option = function
+      None -> Prelude.id
+    | Some x -> T.add x
+
+  let of_list l =
+    List.fold_right T.add l T.empty
+
+  let to_list t =
+    List.rev (T.fold (fun x l -> x::l) t [])
+
+  let add_list l t =
+    List.fold_left (Prelude.flip T.add) t l
+
+  let to_string_sep lparen rparen sep t =
+    let adds i e s = s ^ (if i <> 0 then sep else "") ^ (T.to_string e)
+    in
+    let s = foldi adds t "" in
+    lparen ^ s ^ rparen
+
+  let to_string = to_string_sep T.lparen T.rparen T.separator
+
+  include Stringable.Make((struct
+    type t = T.t
+    let to_string = to_string
+  end : Stringable.Type with type t = T.t))
+end
+
diff --git a/lib/baselib/src/collection.mli b/lib/baselib/src/collection.mli
index d7b1509..61eb774 100644
--- a/lib/baselib/src/collection.mli
+++ b/lib/baselib/src/collection.mli
@@ -1,45 +1,45 @@
-(** base operations and collection type for module of Collection. *)
-module type Type =
-sig
-  type t
-  type elt
-  (** left side parenthesis when convert elt to string *)
-  val lparen : string
-  (** right side parenthesis when convert elt to string *)
-  val rparen : string
-  (** separate each elt when convert elt to string *)
-  val separator : string
-  (** return empty collection *)
-  val empty : t
-  (** add element for elt to t *)
-  val add : elt -> t -> t
-  (** apply each element of t with first element is 'a *)
-  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
-  include Stringable.Type with type t := elt
-end
-
-module type S =
-sig
-  type elt
-  type t
-  (** folding with index of element in t *)
-  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
-  (** execute affects with index of element of t *)
-  val iteri : (int -> elt -> unit) -> t -> unit
-  (** append element to t if arg is Some. *)
-  val add_option : elt option -> t -> t
-  (** convert t from list. *)
-  val of_list : elt list -> t
-  (** convert list from t *)
-  val to_list : t -> elt list
-  (** add all element of list to given t. *)
-  val add_list : elt list -> t -> t
-  (** translate given lparen, rparen, separator and t into string. *)
-  val to_string_sep : string -> string -> string -> t -> string
-
-  (** Stringable Signatures *)
-  include Stringable.Type with type t:= t
-  include Stringable.S with type t := t
-end
-
-module Make (T:Type) : S with type elt := T.elt and type t := T.t
+(** base operations and collection type for module of Collection. *)
+module type Type =
+sig
+  type t
+  type elt
+  (** left side parenthesis when convert elt to string *)
+  val lparen : string
+  (** right side parenthesis when convert elt to string *)
+  val rparen : string
+  (** separate each elt when convert elt to string *)
+  val separator : string
+  (** return empty collection *)
+  val empty : t
+  (** add element for elt to t *)
+  val add : elt -> t -> t
+  (** apply each element of t with first element is 'a *)
+  val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
+  include Stringable.Type with type t := elt
+end
+
+module type S =
+sig
+  type elt
+  type t
+  (** folding with index of element in t *)
+  val foldi : (int -> elt -> 'a -> 'a) -> t -> 'a -> 'a
+  (** execute affects with index of element of t *)
+  val iteri : (int -> elt -> unit) -> t -> unit
+  (** append element to t if arg is Some. *)
+  val add_option : elt option -> t -> t
+  (** convert t from list. *)
+  val of_list : elt list -> t
+  (** convert list from t *)
+  val to_list : t -> elt list
+  (** add all element of list to given t. *)
+  val add_list : elt list -> t -> t
+  (** translate given lparen, rparen, separator and t into string. *)
+  val to_string_sep : string -> string -> string -> t -> string
+
+  (** Stringable Signatures *)
+  include Stringable.Type with type t:= t
+  include Stringable.S with type t := t
+end
+
+module Make (T:Type) : S with type elt := T.elt and type t := T.t
diff --git a/lib/baselib/src/comparable.ml b/lib/baselib/src/comparable.ml
index c8bd839..ba3e401 100644
--- a/lib/baselib/src/comparable.ml
+++ b/lib/baselib/src/comparable.ml
@@ -1,84 +1,84 @@
-type ('a, 'unique_id) t = ('a -> 'a -> int)
-
-(** avoid circular reference  *)
-type ('a, 'unique_id) t_ = ('a, 'unique_id) t
-
-
-module type Type =
-sig
-  type t
-  val compare : t -> t -> int
-end
-
-module type S =
-sig
-  type t
-  type comparator
-  val comparator: (t, comparator) t_
-  val eq : t -> t -> bool
-  val ne : t -> t -> bool
-  val gt : t -> t -> bool
-  val ge : t -> t -> bool
-  val lt : t -> t -> bool
-  val le : t -> t -> bool
-end
-
-module type S1 =
-sig
-  type 'a t
-  type comparator
-  val comparator: ('a t, comparator) t_
-  val eq : 'a t -> 'a t -> bool
-  val ne : 'a t -> 'a t -> bool
-  val gt : 'a t -> 'a t -> bool
-  val ge : 'a t -> 'a t -> bool
-  val lt : 'a t -> 'a t -> bool
-  val le : 'a t -> 'a t -> bool
-end
-
-module Make (T : Type) = struct
-  type t = T.t
-  type comparator
-  let comparator = T.compare
-  let eq t1 t2 = compare t1 t2 = 0
-  let ne t1 t2 = compare t1 t2 <> 0
-  let gt t1 t2 = compare t1 t2 > 0
-  let ge t1 t2 = compare t1 t2 >= 0
-  let lt t1 t2 = compare t1 t2 < 0
-  let le t1 t2 = compare t1 t2 <= 0
-end
-
-module Make1 (T : sig
-  type 'a t
-  val compare: 'a t -> 'a t -> int
-end) = struct
-  type 'a t = 'a T.t
-  type comparator
-  let comparator = T.compare
-  let eq t1 t2 = compare t1 t2 = 0
-  let ne t1 t2 = compare t1 t2 <> 0
-  let gt t1 t2 = compare t1 t2 > 0
-  let ge t1 t2 = compare t1 t2 >= 0
-  let lt t1 t2 = compare t1 t2 < 0
-  let le t1 t2 = compare t1 t2 <= 0
-end
-
-module Poly = struct
-  include Make1 (struct
-    type 'a t = 'a
-    let compare = Pervasives.compare
-  end)
-end
-
-module S_to_S1 (T : S) = struct
-  type 'a t = T.t
-  type comparator = T.comparator
-  let comparator = T.comparator
-
-  let eq = T.eq
-  let ne = T.ne
-  let gt = T.gt
-  let ge = T.ge
-  let lt = T.lt
-  let le = T.le
-end
+type ('a, 'unique_id) t = ('a -> 'a -> int)
+
+(** avoid circular reference  *)
+type ('a, 'unique_id) t_ = ('a, 'unique_id) t
+
+
+module type Type =
+sig
+  type t
+  val compare : t -> t -> int
+end
+
+module type S =
+sig
+  type t
+  type comparator
+  val comparator: (t, comparator) t_
+  val eq : t -> t -> bool
+  val ne : t -> t -> bool
+  val gt : t -> t -> bool
+  val ge : t -> t -> bool
+  val lt : t -> t -> bool
+  val le : t -> t -> bool
+end
+
+module type S1 =
+sig
+  type 'a t
+  type comparator
+  val comparator: ('a t, comparator) t_
+  val eq : 'a t -> 'a t -> bool
+  val ne : 'a t -> 'a t -> bool
+  val gt : 'a t -> 'a t -> bool
+  val ge : 'a t -> 'a t -> bool
+  val lt : 'a t -> 'a t -> bool
+  val le : 'a t -> 'a t -> bool
+end
+
+module Make (T : Type) = struct
+  type t = T.t
+  type comparator
+  let comparator = T.compare
+  let eq t1 t2 = compare t1 t2 = 0
+  let ne t1 t2 = compare t1 t2 <> 0
+  let gt t1 t2 = compare t1 t2 > 0
+  let ge t1 t2 = compare t1 t2 >= 0
+  let lt t1 t2 = compare t1 t2 < 0
+  let le t1 t2 = compare t1 t2 <= 0
+end
+
+module Make1 (T : sig
+  type 'a t
+  val compare: 'a t -> 'a t -> int
+end) = struct
+  type 'a t = 'a T.t
+  type comparator
+  let comparator = T.compare
+  let eq t1 t2 = compare t1 t2 = 0
+  let ne t1 t2 = compare t1 t2 <> 0
+  let gt t1 t2 = compare t1 t2 > 0
+  let ge t1 t2 = compare t1 t2 >= 0
+  let lt t1 t2 = compare t1 t2 < 0
+  let le t1 t2 = compare t1 t2 <= 0
+end
+
+module Poly = struct
+  include Make1 (struct
+    type 'a t = 'a
+    let compare = Pervasives.compare
+  end)
+end
+
+module S_to_S1 (T : S) = struct
+  type 'a t = T.t
+  type comparator = T.comparator
+  let comparator = T.comparator
+
+  let eq = T.eq
+  let ne = T.ne
+  let gt = T.gt
+  let ge = T.ge
+  let lt = T.lt
+  let le = T.le
+end
diff --git a/lib/baselib/src/comparable.mli b/lib/baselib/src/comparable.mli
index 50a1c0f..f4b2d97 100644
--- a/lib/baselib/src/comparable.mli
+++ b/lib/baselib/src/comparable.mli
@@ -1,86 +1,86 @@
-(** this module is used to functor when needs some modules to compare
-    t.
-
-    usage: when you want to add compareable ability into module,
-    include with applying Make that is in this module.
-
-    include Compareable.Make(...)
-*)
-
-type ('a, 'unique_id) t = ('a -> 'a -> int)
-
-(** avoid circular reference, only using inner this module.  *)
-type ('a, 'unique_id) t_ = ('a, 'unique_id) t
-
-(** Provide type-specific function to compare  *)
-module type Type =
-sig
-  type t
-  (** compare elements. if first is less than second, return -1.
-      if first equal second, return 0.
-      return 1 if first is greater than second.
-  *)
-  val compare : t -> t -> int
-end
-
-(** Signature of some functions to compare each specified type *)
-module type S =
-sig
-  type t
-  type comparator
-  val comparator: (t, comparator) t_
-  (** equals between elements *)
-  val eq : t -> t -> bool
-  (** not equals between elements *)
-  val ne : t -> t -> bool
-  (** first element is greater than second *)
-  val gt : t -> t -> bool
-  (** first element is greater equal second *)
-  val ge : t -> t -> bool
-  (** first element is less than second *)
-  val lt : t -> t -> bool
-  (** first element is less equal second *)
-  val le : t -> t -> bool
-
-end
-
-(** Signature of some functions to compare to have a variable type. *)
-module type S1 =
-sig
-  (** element type of this signature. this is had to overwrite when
-      using any module. *)
-  type 'a t
-  type comparator
-  val comparator: ('a t, comparator) t_
-  (** equals between elements *)
-  val eq : 'a t -> 'a t -> bool
-  (** not equals between elements *)
-  val ne : 'a t -> 'a t -> bool
-  (** first element is greater than second *)
-  val gt : 'a t -> 'a t -> bool
-  (** first element is greater equal second *)
-  val ge : 'a t -> 'a t -> bool
-  (** first element is less than second *)
-  val lt : 'a t -> 'a t -> bool
-  (** first element is less equal second *)
-  val le : 'a t -> 'a t -> bool
-
-end
-
-(** comparable module for primitive types that
-    is able to apply polymorphismical Perversive's compare to it.
-*)
-module Poly : S1 with type 'a t = 'a
-
-(** using this module when need order functions. *)
-module Make (T : Type) : S with type t = T.t
-
-(** Use this module to get type-specified comparable module  *)
-module Make1 (T : sig
-  type 'a t
-  val compare : 'a t -> 'a t -> int
-end) : S1 with type 'a t = 'a T.t
-
-(** Convert {!S} to {!S1} *)
-module S_to_S1 (T: S) : S1 with type 'a t = T.t
-                           and type comparator = T.comparator
+(** this module is used to functor when needs some modules to compare
+    t.
+
+    usage: when you want to add compareable ability into module,
+    include with applying Make that is in this module.
+
+    include Compareable.Make(...)
+*)
+
+type ('a, 'unique_id) t = ('a -> 'a -> int)
+
+(** avoid circular reference, only using inner this module.  *)
+type ('a, 'unique_id) t_ = ('a, 'unique_id) t
+
+(** Provide type-specific function to compare  *)
+module type Type =
+sig
+  type t
+  (** compare elements. if first is less than second, return -1.
+      if first equal second, return 0.
+      return 1 if first is greater than second.
+  *)
+  val compare : t -> t -> int
+end
+
+(** Signature of some functions to compare each specified type *)
+module type S =
+sig
+  type t
+  type comparator
+  val comparator: (t, comparator) t_
+  (** equals between elements *)
+  val eq : t -> t -> bool
+  (** not equals between elements *)
+  val ne : t -> t -> bool
+  (** first element is greater than second *)
+  val gt : t -> t -> bool
+  (** first element is greater equal second *)
+  val ge : t -> t -> bool
+  (** first element is less than second *)
+  val lt : t -> t -> bool
+  (** first element is less equal second *)
+  val le : t -> t -> bool
+
+end
+
+(** Signature of some functions to compare to have a variable type. *)
+module type S1 =
+sig
+  (** element type of this signature. this is had to overwrite when
+      using any module. *)
+  type 'a t
+  type comparator
+  val comparator: ('a t, comparator) t_
+  (** equals between elements *)
+  val eq : 'a t -> 'a t -> bool
+  (** not equals between elements *)
+  val ne : 'a t -> 'a t -> bool
+  (** first element is greater than second *)
+  val gt : 'a t -> 'a t -> bool
+  (** first element is greater equal second *)
+  val ge : 'a t -> 'a t -> bool
+  (** first element is less than second *)
+  val lt : 'a t -> 'a t -> bool
+  (** first element is less equal second *)
+  val le : 'a t -> 'a t -> bool
+
+end
+
+(** comparable module for primitive types that
+    is able to apply polymorphismical Perversive's compare to it.
+*)
+module Poly : S1 with type 'a t = 'a
+
+(** using this module when need order functions. *)
+module Make (T : Type) : S with type t = T.t
+
+(** Use this module to get type-specified comparable module  *)
+module Make1 (T : sig
+  type 'a t
+  val compare : 'a t -> 'a t -> int
+end) : S1 with type 'a t = 'a T.t
+
+(** Convert {!S} to {!S1} *)
+module S_to_S1 (T: S) : S1 with type 'a t = T.t
+                           and type comparator = T.comparator
diff --git a/lib/baselib/src/compareStringable.ml b/lib/baselib/src/compareStringable.ml
index a94b579..5d73779 100644
--- a/lib/baselib/src/compareStringable.ml
+++ b/lib/baselib/src/compareStringable.ml
@@ -1,18 +1,18 @@
-
-module type Type =
-  sig
-    include Comparable.Type
-    include Stringable.Type with type t := t
-  end
-
-module type S =
-  sig
-    include Comparable.S
-    include Stringable.S with type t := t
-  end
-
-module Make (T:Type) : S with type t := T.t =
-struct
-  include Comparable.Make(T)
-  include Stringable.Make(T)
-end
+
+module type Type =
+  sig
+    include Comparable.Type
+    include Stringable.Type with type t := t
+  end
+
+module type S =
+  sig
+    include Comparable.S
+    include Stringable.S with type t := t
+  end
+
+module Make (T:Type) : S with type t := T.t =
+struct
+  include Comparable.Make(T)
+  include Stringable.Make(T)
+end
diff --git a/lib/baselib/src/compareStringable.mli b/lib/baselib/src/compareStringable.mli
index abae484..fd0c6ce 100644
--- a/lib/baselib/src/compareStringable.mli
+++ b/lib/baselib/src/compareStringable.mli
@@ -1,25 +1,25 @@
-(** add ability that can compare and convert module.t to string *)
-
-(** Interface for Functor to apply to Make module  *)
-module type Type =
-  sig
-    (** add compareable ability between same module.t  *)
-    include Comparable.Type
-    (** add stringable ability that can convert module.t to string  *)
-    include Stringable.Type with type t := t
-  end
-
-(** Module implementation interface  *)
-module type S =
-  sig
-    include Comparable.S
-    include Stringable.S with type t := t
-  end
-
-(**
-   Make module that add compareable and stringable ability to
-   target module.
-   Prepareing Functor that implemented to Type before make new added
-   module!
-*)
-module Make (T:Type) : S with type t := T.t
+(** add ability that can compare and convert module.t to string *)
+
+(** Interface for Functor to apply to Make module  *)
+module type Type =
+  sig
+    (** add compareable ability between same module.t  *)
+    include Comparable.Type
+    (** add stringable ability that can convert module.t to string  *)
+    include Stringable.Type with type t := t
+  end
+
+(** Module implementation interface  *)
+module type S =
+  sig
+    include Comparable.S
+    include Stringable.S with type t := t
+  end
+
+(**
+   Make module that add compareable and stringable ability to
+   target module.
+   Prepareing Functor that implemented to Type before make new added
+   module!
+*)
+module Make (T:Type) : S with type t := T.t
diff --git a/lib/baselib/src/either.ml b/lib/baselib/src/either.ml
index 3c526e0..babe733 100644
--- a/lib/baselib/src/either.ml
+++ b/lib/baselib/src/either.ml
@@ -1,34 +1,34 @@
-module Core_ = struct
-  type ('a, 'b) t =
-  | Left of 'b
-  | Right of 'a
-
-  let return x = Right x
-  let bind (m : ('a, 'b) t) f =
-    match m with
-      | Left x -> Left x
-      | Right x -> f x
-end
-
-type ('a, 'b) t = ('a, 'b) Core_.t =
-  | Left of 'b
-  | Right of 'a
-
-let either_left e f =
-  match e with
-  | Left s -> Some (f s)
-  | Right _ -> None
-
-let either_right e f =
-  match e with
-  | Left _ -> None
-  | Right s -> Some (f s)
-
-let is_left = function
-  | Left _ -> true
-  | Right _ -> false
-
-let is_right e = not (is_left e)
-
-
-include Monad.Make2(Core_)
+module Core_ = struct
+  type ('a, 'b) t =
+  | Left of 'b
+  | Right of 'a
+
+  let return x = Right x
+  let bind (m : ('a, 'b) t) f =
+    match m with
+      | Left x -> Left x
+      | Right x -> f x
+end
+
+type ('a, 'b) t = ('a, 'b) Core_.t =
+  | Left of 'b
+  | Right of 'a
+
+let either_left e f =
+  match e with
+  | Left s -> Some (f s)
+  | Right _ -> None
+
+let either_right e f =
+  match e with
+  | Left _ -> None
+  | Right s -> Some (f s)
+
+let is_left = function
+  | Left _ -> true
+  | Right _ -> false
+
+let is_right e = not (is_left e)
+
+
+include Monad.Make2(Core_)
diff --git a/lib/baselib/src/either.mli b/lib/baselib/src/either.mli
index e5e1da7..decb195 100644
--- a/lib/baselib/src/either.mli
+++ b/lib/baselib/src/either.mli
@@ -1,51 +1,51 @@
-(** Provide culculation have two way result with type and relative
-    functions for it.
-    And Either providing monadic interface as {!Monad} module.
-
-    Either Monad woking as follows:
-
-    | Left  ->  finishing bind chain and return as Left
-    | Right ->  continue bind chain applied function to Right value
-
-    @author derui
-    @since 0.1
-*)
-
-(** Have two way result. Often Left is failed to culculate and
-    error message, Right as `right' calculation with calculated
-    result.
-
-    Note: Please look cautious type variant of {Either.t} before  use
-    it. Sorry the variant arrangements is not very understand that
-    the first type variant is for {b Right}, and second it is for {b
-    Left}. Reason of this design is to add monadic interface to
-    Either. (Added monadic interface here detail locate in {!monad} module.)
-*)
-type ('a, 'b) t =
-| Left of 'b
-| Right of 'a
-
-(**
-   If given {!either} is left, return applied {!f} to Left value.
-   Return None if given {!either} is Right.
-*)
-val either_left : ('a, 'b) t -> ('b -> 'c) -> 'c option
-
-(**
-   If given {!either} is Right, return applied {!f} to Right value.
-   Return None if given {!either} is Left.
-*)
-val either_right : ('a, 'b) t -> ('a -> 'c) -> 'c option
-
-(**
-   Return the given {!either} is {!Left} or not.
-*)
-val is_left : ('a, 'b) t -> bool
-
-(**
-   Return the given {!either} is {!Right} or not.
-*)
-val is_right : ('a, 'b) t -> bool
-
-(** For Monadic operations *)
-include Monad_intf.S2 with type ('a, 'b) t := ('a, 'b) t
+(** Provide culculation have two way result with type and relative
+    functions for it.
+    And Either providing monadic interface as {!Monad} module.
+
+    Either Monad woking as follows:
+
+    | Left  ->  finishing bind chain and return as Left
+    | Right ->  continue bind chain applied function to Right value
+
+    @author derui
+    @since 0.1
+*)
+
+(** Have two way result. Often Left is failed to culculate and
+    error message, Right as `right' calculation with calculated
+    result.
+
+    Note: Please look cautious type variant of {Either.t} before  use
+    it. Sorry the variant arrangements is not very understand that
+    the first type variant is for {b Right}, and second it is for {b
+    Left}. Reason of this design is to add monadic interface to
+    Either. (Added monadic interface here detail locate in {!monad} module.)
+*)
+type ('a, 'b) t =
+| Left of 'b
+| Right of 'a
+
+(**
+   If given {!either} is left, return applied {!f} to Left value.
+   Return None if given {!either} is Right.
+*)
+val either_left : ('a, 'b) t -> ('b -> 'c) -> 'c option
+
+(**
+   If given {!either} is Right, return applied {!f} to Right value.
+   Return None if given {!either} is Left.
+*)
+val either_right : ('a, 'b) t -> ('a -> 'c) -> 'c option
+
+(**
+   Return the given {!either} is {!Left} or not.
+*)
+val is_left : ('a, 'b) t -> bool
+
+(**
+   Return the given {!either} is {!Right} or not.
+*)
+val is_right : ('a, 'b) t -> bool
+
+(** For Monadic operations *)
+include Monad_intf.S2 with type ('a, 'b) t := ('a, 'b) t
diff --git a/lib/baselib/src/ext_array.ml b/lib/baselib/src/ext_array.ml
index 0e36b0a..1ee5c00 100644
--- a/lib/baselib/src/ext_array.ml
+++ b/lib/baselib/src/ext_array.ml
@@ -1,21 +1,21 @@
-open Prelude
-
-
-let remove origin ~index ~init =
-  let new_array = Array.make (Array.length origin) init in
-  let first_length = index in
-  let second_pos = index + 1 in
-  let second_length = (Array.length origin) - (first_length + 1) in
-  Array.blit origin 0 new_array 0 first_length;
-  Array.blit origin second_pos new_array ((Array.length new_array) - 1) second_length;
-  new_array
-
-let add origin element = Array.append origin [|element|]
-
-let combine_map aa ba f =
-  Array.map (fun ea ->
-        Array.map (fun eb ->
-          f ea eb
-        ) ba
-      ) aa
-  |> Array.to_list |> Array.concat
+open Prelude
+
+
+let remove origin ~index ~init =
+  let new_array = Array.make (Array.length origin) init in
+  let first_length = index in
+  let second_pos = index + 1 in
+  let second_length = (Array.length origin) - (first_length + 1) in
+  Array.blit origin 0 new_array 0 first_length;
+  Array.blit origin second_pos new_array ((Array.length new_array) - 1) second_length;
+  new_array
+
+let add origin element = Array.append origin [|element|]
+
+let combine_map aa ba f =
+  Array.map (fun ea ->
+        Array.map (fun eb ->
+          f ea eb
+        ) ba
+      ) aa
+  |> Array.to_list |> Array.concat
diff --git a/lib/baselib/src/ext_array.mli b/lib/baselib/src/ext_array.mli
index 9130af5..e0e76bb 100644
--- a/lib/baselib/src/ext_array.mli
+++ b/lib/baselib/src/ext_array.mli
@@ -1,36 +1,36 @@
-(** Provide some functions for ocaml array.
-    Containing functions provided are not included Array module of the stdlib.
-
-    @author derui
-    @version 0.2
-*)
-
-(** Remove an element at an given index and return new array removed element.
-    This function uses Array.blit twice for coping array.
-
-    @param array an array to remove an element from
-    @param index the index of an element to remove from array
-    @param init an element to initialize new array.
-    @return new array that is copied original array without a removed element.
-*)
-val remove : 'a array -> index:int -> init:'a -> 'a array
-
-(** Add an element to tail of the array and return new one.
-    Therefore this function is very slow because it copies given array
-    to new array that size is more larger than original one.
-
-    @param array the array to add an element to.
-    @param element the element to add to the array
-    @return new array added a given element.
-*)
-val add : 'a array -> 'a -> 'a array
-
-(** combine_map a b f traverse each element of arrays and apply function.
-    Sequence for applying function to elements of arrays is `f a1 b1', `f a1 b2`... and then
-    `f a2 b1', therefore, count what combine_omap apply function is multiply length of a to length of b,
-    is equal to 110 if length of a is 11 and length b is 10.
-
-    NOTE: combine_map is used to need to apply function all combination of elements of two arrays.
-    So you have to think amount of calculation when use this function.
-*)
-val combine_map: 'a array -> 'b array -> ('a -> 'b -> 'c) -> 'c array
+(** Provide some functions for ocaml array.
+    Containing functions provided are not included Array module of the stdlib.
+
+    @author derui
+    @version 0.2
+*)
+
+(** Remove an element at an given index and return new array removed element.
+    This function uses Array.blit twice for coping array.
+
+    @param array an array to remove an element from
+    @param index the index of an element to remove from array
+    @param init an element to initialize new array.
+    @return new array that is copied original array without a removed element.
+*)
+val remove : 'a array -> index:int -> init:'a -> 'a array
+
+(** Add an element to tail of the array and return new one.
+    Therefore this function is very slow because it copies given array
+    to new array that size is more larger than original one.
+
+    @param array the array to add an element to.
+    @param element the element to add to the array
+    @return new array added a given element.
+*)
+val add : 'a array -> 'a -> 'a array
+
+(** combine_map a b f traverse each element of arrays and apply function.
+    Sequence for applying function to elements of arrays is `f a1 b1', `f a1 b2`... and then
+    `f a2 b1', therefore, count what combine_omap apply function is multiply length of a to length of b,
+    is equal to 110 if length of a is 11 and length b is 10.
+
+    NOTE: combine_map is used to need to apply function all combination of elements of two arrays.
+    So you have to think amount of calculation when use this function.
+*)
+val combine_map: 'a array -> 'b array -> ('a -> 'b -> 'c) -> 'c array
diff --git a/lib/baselib/src/ext_list.ml b/lib/baselib/src/ext_list.ml
index 3d35c1f..fb17af3 100644
--- a/lib/baselib/src/ext_list.ml
+++ b/lib/baselib/src/ext_list.ml
@@ -1,24 +1,24 @@
-open Num
-
-(* return list within the compass of given min to given max. *)
-let range (s, l) =
-  let rec range_ cur lst =
-    if cur >/ l then List.rev lst
-    else range_ (succ_num cur) (cur :: lst)
-  in range_ s []
-
-let range_int (s, l) =
-  List.map int_of_num (range (num_of_int s, num_of_int l))
-
-let range_float ~step ~fromto:(s, e) =
-  let rec range_ cur lst =
-    if cur > e then List.rev lst
-    else range_ (cur +. step) (cur :: lst)
-  in range_ s []
-
-let init n f =
-  let f = fun l n -> l @ [(f n)] in
-  List.fold_left f [] (range_int (0, n - 1))
-
-let (--) mi ma = range_int (mi, ma)
-let (--/) mi ma = range (mi, ma)
+open Num
+
+(* return list within the compass of given min to given max. *)
+let range (s, l) =
+  let rec range_ cur lst =
+    if cur >/ l then List.rev lst
+    else range_ (succ_num cur) (cur :: lst)
+  in range_ s []
+
+let range_int (s, l) =
+  List.map int_of_num (range (num_of_int s, num_of_int l))
+
+let range_float ~step ~fromto:(s, e) =
+  let rec range_ cur lst =
+    if cur > e then List.rev lst
+    else range_ (cur +. step) (cur :: lst)
+  in range_ s []
+
+let init n f =
+  let f = fun l n -> l @ [(f n)] in
+  List.fold_left f [] (range_int (0, n - 1))
+
+let (--) mi ma = range_int (mi, ma)
+let (--/) mi ma = range (mi, ma)
diff --git a/lib/baselib/src/ext_list.mli b/lib/baselib/src/ext_list.mli
index b0bb91e..c128973 100644
--- a/lib/baselib/src/ext_list.mli
+++ b/lib/baselib/src/ext_list.mli
@@ -1,31 +1,31 @@
-(** Extention for List.
-    Contained some extentional functions for {!List},
-    and utility for List.
-
-    All functions in this module are integrated with {!List} where
-    be in {!Std} module.
-*)
-
-(** return list within the compass of given min to given max. *)
-val range : Num.num * Num.num -> Num.num list
-
-(** range specified for int. detail behavior equals {!range} *)
-val range_int : int * int -> int list
-
-(** range of float values are specified by each value step, start and end of range.  *)
-val range_float : step:float -> fromto:float * float -> float list
-
-(**
-   initialization list. this return list that applied each \[0..n) to
-   f. it likes \[f(0);f(1);..f(n-1)\]
-*)
-val init : int -> (int -> 'a) -> 'a list
-
-(** return list within the compass of given min to given max.
-    This function is alias to {!range_int}
-*)
-val (--) : int -> int -> int list
-
-(** This function is alias to {!range}
-*)
-val (--/) : Num.num -> Num.num -> Num.num list
+(** Extention for List.
+    Contained some extentional functions for {!List},
+    and utility for List.
+
+    All functions in this module are integrated with {!List} where
+    be in {!Std} module.
+*)
+
+(** return list within the compass of given min to given max. *)
+val range : Num.num * Num.num -> Num.num list
+
+(** range specified for int. detail behavior equals {!range} *)
+val range_int : int * int -> int list
+
+(** range of float values are specified by each value step, start and end of range.  *)
+val range_float : step:float -> fromto:float * float -> float list
+
+(**
+   initialization list. this return list that applied each \[0..n) to
+   f. it likes \[f(0);f(1);..f(n-1)\]
+*)
+val init : int -> (int -> 'a) -> 'a list
+
+(** return list within the compass of given min to given max.
+    This function is alias to {!range_int}
+*)
+val (--) : int -> int -> int list
+
+(** This function is alias to {!range}
+*)
+val (--/) : Num.num -> Num.num -> Num.num list
diff --git a/lib/baselib/src/ext_map.ml b/lib/baselib/src/ext_map.ml
index 3fc307a..ef0eb57 100644
--- a/lib/baselib/src/ext_map.ml
+++ b/lib/baselib/src/ext_map.ml
@@ -1,430 +1,430 @@
-open Ext_map_intf
-
-(* Based on "AA tree".
-   But changes direction to fixup function perform that is to root-to-leaf,
-   so minimum cost for calculation is more than basic theory and implements.
-*)
-module Tree = struct
-
-  (* color of node and leaf *)
-  type color = Red | Black
-
-  (* element of tree.
-     Empty is leaf as watcher, so virtual root and leaf.
-  *)
-  type ('k, 'v) t =
-    | Empty                     (* always level 1 *)
-    (* Node have level always greater than 1.  *)
-    | Node of int *                         (* level of node *)
-        ('k, 'v) t *                    (* left child *)
-        'k *                            (* key of node *)
-        'v *                          (* data of node *)
-        ('k, 'v) t                  (* right child *)
-
-  (* helper function *)
-  let level = function
-    | Empty -> 1
-    | Node (l, _, _, _, _) -> l
-
-  (* create empty root *)
-  let empty = Empty
-
-  let is_empty = function
-    | Empty -> true
-    | Node _ -> false
-
-  (* create map single key with data. Node have always left and right Empty as leaf. *)
-  let singleton k d = Node (2, Empty, k, d, Empty)
-
-  (* find node from tree with target key.
-     If node having key is not found, return None
-  *)
-  let rec search tree k compare_key =
-    match tree with
-    | Empty -> None
-    | Node (_, l, nk, v, r) ->
-      let c = compare_key k nk in
-      if c = 0 then
-        Some v
-      else if c < 0 then
-        search l k compare_key
-      else
-        search r k compare_key
-
-  (* tests that if element having k is located in tree*)
-  let exists tree k compare_key = Option.is_some (search tree k compare_key)
-
-  (* balance horizontal left link *)
-  let skew = function
-    | Empty -> Empty
-    (* Node have two child both of leaf *)
-    | Node (_, Empty, _, _, Empty) as n -> n
-    (* skew *)
-    | Node (level, Node (llevel, ll, lk, ld, lr), k, d, r) as n ->
-      if level = llevel then
-        Node (llevel, ll, lk, ld, Node (level, lr, k, d, r))
-      else
-        n
-    | _ as n -> n
-
-  (* balance horizontal right-right link *)
-  let split = function
-    | Empty -> Empty
-    (* Node have two child both of leaf *)
-    | Node (_, Empty, _, _, Empty) as n -> n
-    (* split *)
-    | Node (lvl, l, k, d, Node (rlevel, rl, rk, rd, rr)) as n ->
-      if lvl = level rr then
-        Node (rlevel + 1, Node (lvl, l, k, d, rl), rk, rd, rr)
-      else
-        n
-    | _ as n -> n
-
-  (* fix unbalanced tree to balance tree *)
-  let fixup_balance tree = split (skew tree)
-
-  (* add key-value pair to given tree and return added tree. *)
-  let add tree ~key ~data ~compare_key =
-    let rec add_inner tree key data =
-      match tree with
-      | Empty -> singleton key data
-      | Node (level, l, k, d, r) ->
-        (* apply fixup_balance each separated tree *)
-        let c = compare_key key k in
-        if c < 0 then
-          fixup_balance (Node (level, (add_inner l key data), k, d, r))
-        else if c = 0 then
-          fixup_balance (Node (level, l, key, data, r))
-        else
-          fixup_balance (Node (level, l, k, d, (add_inner r key data)))
-    in
-    add_inner tree key data
-
-    (* convert tree to assoc-list ordered ascending *)
-  let of_alist tree =
-    let rec of_alist_sub tree lst =
-      match tree with
-      | Empty -> lst
-      | Node (_, l, k, d, r) ->
-        of_alist_sub r ((k, d) :: (of_alist_sub l lst))
-    in
-    List.rev (of_alist_sub tree [])
-
-  (** Return value related minimum key in given tree. If empty tree is given,
-      return None.
-  *)
-  let rec minimum = function
-    | Empty -> raise (Invalid_argument "minimum don't accept Empty tree")
-    | Node (_, Empty, k, d, r) as n -> n
-    | Node (_, l, _, _, _) -> minimum l
-
-  (** Return value related minimum key in given tree. If empty tree is given,
-      return None.
-  *)
-  let rec maximum = function
-    | Empty -> raise (Invalid_argument "maxmum don't accept Empty tree")
-    | Node (_, _, k, _, Empty) as n -> n
-    | Node (_, _, _, _, r) -> maximum r
-
-  (* Return minimum key-value pair  *)
-  let min_binding tree =
-    match minimum tree with
-    | Empty -> raise (Invalid_argument "min_binding don't accept Empty tree")
-    | Node (_, _, k, d, _) -> (k, d)
-
-  (* Return maximum key-value pair *)
-  let max_binding tree =
-    match maximum tree with
-    | Empty -> raise (Invalid_argument "max_binding don't accept Empty tree")
-    | Node (_, _, k, d, _) -> (k, d)
-
-
-  (* return successor node of root node. If successor is nothing when
-     root node don't have right child, return Empty
-  *)
-  let successor = function
-    | Empty -> Empty
-    | Node (_, _, _, _, Empty) -> Empty
-    | Node (_, _, _, _, r) -> minimum r
-
-  (* return predecessor node of root node. If predecessor is nothing when
-     root node don't have left child, return Empty
-  *)
-  let predecessor = function
-    | Empty -> Empty
-    | Node (_, Empty, _, _, _) -> Empty
-    | Node (_, l, _, _, _) -> maximum l
-
-  (* decrease current level of node. The result of this function is
-     level of root and right equivalence or right is equal to root level - 1.
-  *)
-  let decrease_level tree =
-    match tree with
-    | Empty -> Empty
-    | Node (lvl, l, k, d, Empty) ->
-      let should_be = (min (level l) (level Empty)) + 1 in
-      Node (min lvl should_be, l, k, d, Empty)
-    | Node (lvl, l, k, d, Node (rlvl, rl, rk, rd, rr)) ->
-      let should_be = (min (level l) (level (Node (rlvl, rl, rk, rd, rr)))) + 1 in
-      Node (min lvl should_be, l, k, d, Node (min rlvl should_be, rl, rk, rd, rr))
-
-  let remove_fixup_balance tree =
-    let skew_all_level tree =
-      match tree with
-      | Empty -> Empty
-      | Node (lvl, l, k, d, Empty) -> Empty
-      | Node (lvl, l, k, d, r) ->
-        match r with
-        | Empty -> Empty
-        | Node (_, _, _, _, Empty) ->
-          Node (lvl, l, k, d, skew r)
-        | Node (_, _, _, _, Node _ ) as r ->
-          begin match skew r with
-          | Empty -> failwith "Ext_map.remove_fixup_balance: inconceivative pattern match"
-          | Node (rlvl, rl, rk, rd, rr) ->
-            Node (lvl, l, k, d, Node (rlvl, rl, rk, rd, skew rr))
-          end in
-    let split_all_level = function
-      | Empty -> Empty
-      | Node (lvl, l, k, d, Empty) as n ->
-        split n
-      | Node (lvl, l, k, d, r) as n ->
-        begin match split n with
-        | Empty -> failwith "Ext_map.remove_fixup.balance: inconceivative pattern match"
-        | Node (lvl, l, k, d, r) ->
-          Node (lvl, l, k, d, split r)
-        end in
-    match tree with
-    | Empty -> Empty
-    | Node _ ->
-      split_all_level (skew_all_level tree)
-
-  (** Remove a pair related key and value, then return removed tree.
-      If key don't contain given tree, return tree without change.
-  *)
-  let rec remove tree key compare_key =
-    let rec remove_ tree key compare_key =
-      match tree with
-      | Empty -> Empty
-      | Node (_, l, k, d, r) ->
-        let c = compare_key k key in
-        if c < 0 then
-          remove_ l key compare_key
-        else if c > 0 then
-          remove_ r key compare_key
-        else
-          match tree with
-          | Empty -> failwith "don't reachpattern match"
-          | Node (lvl, Empty, k, d, Empty) -> Empty
-          | Node (lvl, Empty, k, d, Node _) as tree ->
-            begin match successor tree with
-            | Empty -> failwith "don't reach pattern match"
-            | Node (llvl, ll, lk, ld, lr) ->
-              Node (lvl, Empty, lk, ld, remove_ r key compare_key)
-            end
-          | Node (lvl, Node _, k, d, r) ->
-            begin match predecessor tree with
-            | Empty -> failwith "don't reach pattern match"
-            | Node (llvl, ll, lk, ld, lr) ->
-              Node (lvl, remove_ l lk compare_key, lk, ld, r)
-            end in
-    let removed = remove_ tree key compare_key in
-    let removed = decrease_level removed in
-    remove_fixup_balance removed
-
-  let rec fold tree ~f ~init:accu =
-    match tree with
-    | Empty -> accu
-    | Node (_, l, k, d, r) ->
-      fold r ~f ~init:(f ~key:k ~data:d (fold l ~f ~init:accu))
-
-  let rec map tree ~f ~compare_key =
-    match tree with
-    | Empty -> Empty
-    | Node (lvl, l, k, d, r) ->
-      let l = map l ~f ~compare_key in
-      let d = f d in
-      let r = map r ~f ~compare_key in
-      Node (lvl, l, k, d, r)
-
-  let rec mapi tree ~f ~compare_key =
-    match tree with
-    | Empty -> Empty
-    | Node (lvl, l, k, d, r) ->
-      let l = mapi l ~f ~compare_key in
-      let d = f ~key:k ~data:d in
-      let r = mapi r ~f ~compare_key in
-      Node (lvl, l, k, d, r)
-
-  let rec iter tree f compare_key =
-    match tree with
-    | Empty -> ()
-    | Node (lvl, l, k, d, r) ->
-      iter l f compare_key;
-      f d;
-      iter r f compare_key
-
-  let rec iteri tree f compare_key =
-    match tree with
-    | Empty -> ()
-    | Node (lvl, l, k, d, r) ->
-      iteri l f compare_key;
-      f ~key:k ~data:d;
-      iteri r f compare_key
-
-  let keys tree =
-    fold tree ~f:(fun ~key ~data lst -> key :: lst) ~init:[]
-
-  let data tree =
-    fold tree ~f:(fun ~key ~data lst -> data :: lst) ~init:[]
-
-  type ('a, 'b) enumeration = End | More of 'a * 'b * ('a, 'b) t * ('a, 'b) enumeration
-
-  let rec cons_enum m e =
-    match m with
-    | Empty -> e
-    | Node (lvl, l, v, d, r) -> cons_enum l (More (v, d, r, e))
-
-  let compare f first second compare_key =
-    let rec compare_aux first second =
-      match (first, second) with
-      | (End, End) -> 0
-      | (_, End) -> (-1)
-      | (End, _) -> 1
-      | (More (k1, d1, r1, e1), More (k2, d2, r2, e2)) ->
-        let c = compare_key k1 k2 in
-        if c <> 0 then c else
-          let c = f d1 d2 in
-          if c <> 0 then c else
-            compare_aux (cons_enum r1 e1) (cons_enum r2 e1)
-    in compare_aux (cons_enum first End) (cons_enum second End)
-
-  let equal f first second compare_key =
-    let rec equal_aux first second =
-      match (first, second) with
-      | (End, End) -> true
-      | (_, End) -> false
-      | (End, _) -> false
-      | (More (k1, d1, r1, e1), More (k2, d2, r2, e2)) ->
-        compare_key k1 k2 = 0 && f d1 d2 && equal_aux (cons_enum r1 e1) (cons_enum r2 e1)
-    in equal_aux (cons_enum first End) (cons_enum second End)
-
-end
-
-(* type for generic map  *)
-type ('k, 'v, 'comparator) t = {tree:('k, 'v) Tree.t;
-                                comparator:('k, 'comparator) Comparable.t
-                               }
-type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
-
-(* define creator functions with comparators. *)
-let empty ~comparator = {tree = Tree.empty; comparator}
-
-let singleton ~comparator k v = {tree = Tree.singleton k v; comparator}
-
-let of_alist ~comparator {tree;_} = Tree.of_alist tree
-
-(* define functorized {!Creator} and {!Accessor} for Functor *)
-module Creator (Key:Comparable.S1) : sig
-  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
-  type ('k, 'v, 'c) t_ = ('k Key.t, 'v, Key.comparator) t
-
-  include Creator with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
-                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
-                  and type 'k key := 'k Key.t
-end = struct
-  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
-  type ('k, 'v, 'c) t_ = ('k Key.t, 'v, Key.comparator) t
-  let comparator = Key.comparator
-
-  let empty = {tree = Tree.empty;comparator}
-  let singleton k v = singleton ~comparator k v
-  let of_alist map = of_alist ~comparator map
-end
-
-module Accessor = struct
-  let is_empty t = Tree.is_empty t.tree
-  let add t ~key ~data = {t with tree = Tree.add t.tree ~key ~data ~compare_key:t.comparator;}
-  let remove t key = {t with tree = Tree.remove t.tree key t.comparator;}
-  let minimum t = try Some (Tree.min_binding t.tree) with Invalid_argument _ -> None
-  let minimum_exn t = Tree.min_binding t.tree
-  let maximum t = try Some (Tree.max_binding t.tree) with Invalid_argument _ -> None
-  let maximum_exn t = Tree.max_binding t.tree
-  let find t key = Tree.search t.tree key t.comparator
-  let find_exn t key =
-    match Tree.search t.tree key t.comparator with
-    | None -> raise Not_found
-    | Some x -> x
-  let mem t key = Tree.exists t.tree key t.comparator
-  let iter t f = Tree.iter t.tree f t.comparator
-  let iteri t f = Tree.iteri t.tree f t.comparator
-  let map t f = {t with tree = Tree.map t.tree f t.comparator}
-  let mapi t f = {t with tree = Tree.mapi t.tree f t.comparator}
-  let fold t ~f ~init = Tree.fold t.tree ~f ~init
-  let compare f t1 t2 = Tree.compare f t1.tree t2.tree t1.comparator
-  let equal f t1 t2 = Tree.equal f t1.tree t2.tree t1.comparator
-  let keys t = Tree.keys t.tree
-  let data t = Tree.data t.tree
-end
-
-module Functor_accessor(Key:Comparable.S) = struct
-  let is_empty t = Tree.is_empty t.tree
-  let add t ~key ~data = {t with tree = Tree.add t.tree ~key ~data ~compare_key:t.comparator;}
-  let remove t key = {t with tree = Tree.remove t.tree key t.comparator;}
-  let minimum t = try Some (Tree.min_binding t.tree) with Invalid_argument _ -> None
-  let minimum_exn t = Tree.min_binding t.tree
-  let maximum t = try Some (Tree.max_binding t.tree) with Invalid_argument _ -> None
-  let maximum_exn t = Tree.max_binding t.tree
-  let find t key = Tree.search t.tree key t.comparator
-  let find_exn t key =
-    match Tree.search t.tree key t.comparator with
-    | None -> raise Not_found
-    | Some x -> x
-  let mem t key = Tree.exists t.tree key t.comparator
-  let iter t f = Tree.iter t.tree f t.comparator
-  let iteri t f = Tree.iteri t.tree f t.comparator
-  let map t f = {t with tree = Tree.map t.tree f t.comparator}
-  let mapi t f = {t with tree = Tree.mapi t.tree f t.comparator}
-  let fold t ~f ~init = Tree.fold t.tree ~f ~init
-  let compare f t1 t2 = Tree.compare f t1.tree t2.tree t1.comparator
-  let equal f t1 t2 = Tree.equal f t1.tree t2.tree t1.comparator
-  let keys t = []
-  let data t = Tree.data t.tree
-end
-
-type 'k key = 'k
-include Accessor
-
-module type Key = Key
-(* Used by to make key-specified {!Map} module by {!Make} *)
-module type S = S
-  with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
-
-module Make_use_comparator(Key:Comparable.S) = struct
-  module Key = Key
-
-  include Creator (Comparable.S_to_S1(Key))
-  type key = Key.t
-  type ('a, 'b, 'c) map = (Key.t, 'b, Key.comparator) t
-  type 'v t = (Key.t, 'v, Key.comparator) map
-  type 'k key_ = key
-
-  include Accessor
-end
-
-(* Make key-specified module with functor implemented
-   compare between a key and define the type of key
-*)
-module Make(Key:Comparable.Type) = Make_use_comparator(Comparable.Make(Key))
-
-module Poly = struct
-  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
-  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
-  type 'a key = 'a
-
-  (* creator functions *)
-  include Creator (Comparable.Poly)
-  (* accessors *)
-  include Accessor
-
-end
+open Ext_map_intf
+
+(* Based on "AA tree".
+   But changes direction to fixup function perform that is to root-to-leaf,
+   so minimum cost for calculation is more than basic theory and implements.
+*)
+module Tree = struct
+
+  (* color of node and leaf *)
+  type color = Red | Black
+
+  (* element of tree.
+     Empty is leaf as watcher, so virtual root and leaf.
+  *)
+  type ('k, 'v) t =
+    | Empty                     (* always level 1 *)
+    (* Node have level always greater than 1.  *)
+    | Node of int *                         (* level of node *)
+        ('k, 'v) t *                    (* left child *)
+        'k *                            (* key of node *)
+        'v *                          (* data of node *)
+        ('k, 'v) t                  (* right child *)
+
+  (* helper function *)
+  let level = function
+    | Empty -> 1
+    | Node (l, _, _, _, _) -> l
+
+  (* create empty root *)
+  let empty = Empty
+
+  let is_empty = function
+    | Empty -> true
+    | Node _ -> false
+
+  (* create map single key with data. Node have always left and right Empty as leaf. *)
+  let singleton k d = Node (2, Empty, k, d, Empty)
+
+  (* find node from tree with target key.
+     If node having key is not found, return None
+  *)
+  let rec search tree k compare_key =
+    match tree with
+    | Empty -> None
+    | Node (_, l, nk, v, r) ->
+      let c = compare_key k nk in
+      if c = 0 then
+        Some v
+      else if c < 0 then
+        search l k compare_key
+      else
+        search r k compare_key
+
+  (* tests that if element having k is located in tree*)
+  let exists tree k compare_key = Option.is_some (search tree k compare_key)
+
+  (* balance horizontal left link *)
+  let skew = function
+    | Empty -> Empty
+    (* Node have two child both of leaf *)
+    | Node (_, Empty, _, _, Empty) as n -> n
+    (* skew *)
+    | Node (level, Node (llevel, ll, lk, ld, lr), k, d, r) as n ->
+      if level = llevel then
+        Node (llevel, ll, lk, ld, Node (level, lr, k, d, r))
+      else
+        n
+    | _ as n -> n
+
+  (* balance horizontal right-right link *)
+  let split = function
+    | Empty -> Empty
+    (* Node have two child both of leaf *)
+    | Node (_, Empty, _, _, Empty) as n -> n
+    (* split *)
+    | Node (lvl, l, k, d, Node (rlevel, rl, rk, rd, rr)) as n ->
+      if lvl = level rr then
+        Node (rlevel + 1, Node (lvl, l, k, d, rl), rk, rd, rr)
+      else
+        n
+    | _ as n -> n
+
+  (* fix unbalanced tree to balance tree *)
+  let fixup_balance tree = split (skew tree)
+
+  (* add key-value pair to given tree and return added tree. *)
+  let add tree ~key ~data ~compare_key =
+    let rec add_inner tree key data =
+      match tree with
+      | Empty -> singleton key data
+      | Node (level, l, k, d, r) ->
+        (* apply fixup_balance each separated tree *)
+        let c = compare_key key k in
+        if c < 0 then
+          fixup_balance (Node (level, (add_inner l key data), k, d, r))
+        else if c = 0 then
+          fixup_balance (Node (level, l, key, data, r))
+        else
+          fixup_balance (Node (level, l, k, d, (add_inner r key data)))
+    in
+    add_inner tree key data
+
+    (* convert tree to assoc-list ordered ascending *)
+  let of_alist tree =
+    let rec of_alist_sub tree lst =
+      match tree with
+      | Empty -> lst
+      | Node (_, l, k, d, r) ->
+        of_alist_sub r ((k, d) :: (of_alist_sub l lst))
+    in
+    List.rev (of_alist_sub tree [])
+
+  (** Return value related minimum key in given tree. If empty tree is given,
+      return None.
+  *)
+  let rec minimum = function
+    | Empty -> raise (Invalid_argument "minimum don't accept Empty tree")
+    | Node (_, Empty, k, d, r) as n -> n
+    | Node (_, l, _, _, _) -> minimum l
+
+  (** Return value related minimum key in given tree. If empty tree is given,
+      return None.
+  *)
+  let rec maximum = function
+    | Empty -> raise (Invalid_argument "maxmum don't accept Empty tree")
+    | Node (_, _, k, _, Empty) as n -> n
+    | Node (_, _, _, _, r) -> maximum r
+
+  (* Return minimum key-value pair  *)
+  let min_binding tree =
+    match minimum tree with
+    | Empty -> raise (Invalid_argument "min_binding don't accept Empty tree")
+    | Node (_, _, k, d, _) -> (k, d)
+
+  (* Return maximum key-value pair *)
+  let max_binding tree =
+    match maximum tree with
+    | Empty -> raise (Invalid_argument "max_binding don't accept Empty tree")
+    | Node (_, _, k, d, _) -> (k, d)
+
+
+  (* return successor node of root node. If successor is nothing when
+     root node don't have right child, return Empty
+  *)
+  let successor = function
+    | Empty -> Empty
+    | Node (_, _, _, _, Empty) -> Empty
+    | Node (_, _, _, _, r) -> minimum r
+
+  (* return predecessor node of root node. If predecessor is nothing when
+     root node don't have left child, return Empty
+  *)
+  let predecessor = function
+    | Empty -> Empty
+    | Node (_, Empty, _, _, _) -> Empty
+    | Node (_, l, _, _, _) -> maximum l
+
+  (* decrease current level of node. The result of this function is
+     level of root and right equivalence or right is equal to root level - 1.
+  *)
+  let decrease_level tree =
+    match tree with
+    | Empty -> Empty
+    | Node (lvl, l, k, d, Empty) ->
+      let should_be = (min (level l) (level Empty)) + 1 in
+      Node (min lvl should_be, l, k, d, Empty)
+    | Node (lvl, l, k, d, Node (rlvl, rl, rk, rd, rr)) ->
+      let should_be = (min (level l) (level (Node (rlvl, rl, rk, rd, rr)))) + 1 in
+      Node (min lvl should_be, l, k, d, Node (min rlvl should_be, rl, rk, rd, rr))
+
+  let remove_fixup_balance tree =
+    let skew_all_level tree =
+      match tree with
+      | Empty -> Empty
+      | Node (lvl, l, k, d, Empty) -> Empty
+      | Node (lvl, l, k, d, r) ->
+        match r with
+        | Empty -> Empty
+        | Node (_, _, _, _, Empty) ->
+          Node (lvl, l, k, d, skew r)
+        | Node (_, _, _, _, Node _ ) as r ->
+          begin match skew r with
+          | Empty -> failwith "Ext_map.remove_fixup_balance: inconceivative pattern match"
+          | Node (rlvl, rl, rk, rd, rr) ->
+            Node (lvl, l, k, d, Node (rlvl, rl, rk, rd, skew rr))
+          end in
+    let split_all_level = function
+      | Empty -> Empty
+      | Node (lvl, l, k, d, Empty) as n ->
+        split n
+      | Node (lvl, l, k, d, r) as n ->
+        begin match split n with
+        | Empty -> failwith "Ext_map.remove_fixup.balance: inconceivative pattern match"
+        | Node (lvl, l, k, d, r) ->
+          Node (lvl, l, k, d, split r)
+        end in
+    match tree with
+    | Empty -> Empty
+    | Node _ ->
+      split_all_level (skew_all_level tree)
+
+  (** Remove a pair related key and value, then return removed tree.
+      If key don't contain given tree, return tree without change.
+  *)
+  let rec remove tree key compare_key =
+    let rec remove_ tree key compare_key =
+      match tree with
+      | Empty -> Empty
+      | Node (_, l, k, d, r) ->
+        let c = compare_key k key in
+        if c < 0 then
+          remove_ l key compare_key
+        else if c > 0 then
+          remove_ r key compare_key
+        else
+          match tree with
+          | Empty -> failwith "don't reachpattern match"
+          | Node (lvl, Empty, k, d, Empty) -> Empty
+          | Node (lvl, Empty, k, d, Node _) as tree ->
+            begin match successor tree with
+            | Empty -> failwith "don't reach pattern match"
+            | Node (llvl, ll, lk, ld, lr) ->
+              Node (lvl, Empty, lk, ld, remove_ r key compare_key)
+            end
+          | Node (lvl, Node _, k, d, r) ->
+            begin match predecessor tree with
+            | Empty -> failwith "don't reach pattern match"
+            | Node (llvl, ll, lk, ld, lr) ->
+              Node (lvl, remove_ l lk compare_key, lk, ld, r)
+            end in
+    let removed = remove_ tree key compare_key in
+    let removed = decrease_level removed in
+    remove_fixup_balance removed
+
+  let rec fold tree ~f ~init:accu =
+    match tree with
+    | Empty -> accu
+    | Node (_, l, k, d, r) ->
+      fold r ~f ~init:(f ~key:k ~data:d (fold l ~f ~init:accu))
+
+  let rec map tree ~f ~compare_key =
+    match tree with
+    | Empty -> Empty
+    | Node (lvl, l, k, d, r) ->
+      let l = map l ~f ~compare_key in
+      let d = f d in
+      let r = map r ~f ~compare_key in
+      Node (lvl, l, k, d, r)
+
+  let rec mapi tree ~f ~compare_key =
+    match tree with
+    | Empty -> Empty
+    | Node (lvl, l, k, d, r) ->
+      let l = mapi l ~f ~compare_key in
+      let d = f ~key:k ~data:d in
+      let r = mapi r ~f ~compare_key in
+      Node (lvl, l, k, d, r)
+
+  let rec iter tree f compare_key =
+    match tree with
+    | Empty -> ()
+    | Node (lvl, l, k, d, r) ->
+      iter l f compare_key;
+      f d;
+      iter r f compare_key
+
+  let rec iteri tree f compare_key =
+    match tree with
+    | Empty -> ()
+    | Node (lvl, l, k, d, r) ->
+      iteri l f compare_key;
+      f ~key:k ~data:d;
+      iteri r f compare_key
+
+  let keys tree =
+    fold tree ~f:(fun ~key ~data lst -> key :: lst) ~init:[]
+
+  let data tree =
+    fold tree ~f:(fun ~key ~data lst -> data :: lst) ~init:[]
+
+  type ('a, 'b) enumeration = End | More of 'a * 'b * ('a, 'b) t * ('a, 'b) enumeration
+
+  let rec cons_enum m e =
+    match m with
+    | Empty -> e
+    | Node (lvl, l, v, d, r) -> cons_enum l (More (v, d, r, e))
+
+  let compare f first second compare_key =
+    let rec compare_aux first second =
+      match (first, second) with
+      | (End, End) -> 0
+      | (_, End) -> (-1)
+      | (End, _) -> 1
+      | (More (k1, d1, r1, e1), More (k2, d2, r2, e2)) ->
+        let c = compare_key k1 k2 in
+        if c <> 0 then c else
+          let c = f d1 d2 in
+          if c <> 0 then c else
+            compare_aux (cons_enum r1 e1) (cons_enum r2 e1)
+    in compare_aux (cons_enum first End) (cons_enum second End)
+
+  let equal f first second compare_key =
+    let rec equal_aux first second =
+      match (first, second) with
+      | (End, End) -> true
+      | (_, End) -> false
+      | (End, _) -> false
+      | (More (k1, d1, r1, e1), More (k2, d2, r2, e2)) ->
+        compare_key k1 k2 = 0 && f d1 d2 && equal_aux (cons_enum r1 e1) (cons_enum r2 e1)
+    in equal_aux (cons_enum first End) (cons_enum second End)
+
+end
+
+(* type for generic map  *)
+type ('k, 'v, 'comparator) t = {tree:('k, 'v) Tree.t;
+                                comparator:('k, 'comparator) Comparable.t
+                               }
+type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
+
+(* define creator functions with comparators. *)
+let empty ~comparator = {tree = Tree.empty; comparator}
+
+let singleton ~comparator k v = {tree = Tree.singleton k v; comparator}
+
+let of_alist ~comparator {tree;_} = Tree.of_alist tree
+
+(* define functorized {!Creator} and {!Accessor} for Functor *)
+module Creator (Key:Comparable.S1) : sig
+  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
+  type ('k, 'v, 'c) t_ = ('k Key.t, 'v, Key.comparator) t
+
+  include Creator with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
+                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
+                  and type 'k key := 'k Key.t
+end = struct
+  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
+  type ('k, 'v, 'c) t_ = ('k Key.t, 'v, Key.comparator) t
+  let comparator = Key.comparator
+
+  let empty = {tree = Tree.empty;comparator}
+  let singleton k v = singleton ~comparator k v
+  let of_alist map = of_alist ~comparator map
+end
+
+module Accessor = struct
+  let is_empty t = Tree.is_empty t.tree
+  let add t ~key ~data = {t with tree = Tree.add t.tree ~key ~data ~compare_key:t.comparator;}
+  let remove t key = {t with tree = Tree.remove t.tree key t.comparator;}
+  let minimum t = try Some (Tree.min_binding t.tree) with Invalid_argument _ -> None
+  let minimum_exn t = Tree.min_binding t.tree
+  let maximum t = try Some (Tree.max_binding t.tree) with Invalid_argument _ -> None
+  let maximum_exn t = Tree.max_binding t.tree
+  let find t key = Tree.search t.tree key t.comparator
+  let find_exn t key =
+    match Tree.search t.tree key t.comparator with
+    | None -> raise Not_found
+    | Some x -> x
+  let mem t key = Tree.exists t.tree key t.comparator
+  let iter t f = Tree.iter t.tree f t.comparator
+  let iteri t f = Tree.iteri t.tree f t.comparator
+  let map t f = {t with tree = Tree.map t.tree f t.comparator}
+  let mapi t f = {t with tree = Tree.mapi t.tree f t.comparator}
+  let fold t ~f ~init = Tree.fold t.tree ~f ~init
+  let compare f t1 t2 = Tree.compare f t1.tree t2.tree t1.comparator
+  let equal f t1 t2 = Tree.equal f t1.tree t2.tree t1.comparator
+  let keys t = Tree.keys t.tree
+  let data t = Tree.data t.tree
+end
+
+module Functor_accessor(Key:Comparable.S) = struct
+  let is_empty t = Tree.is_empty t.tree
+  let add t ~key ~data = {t with tree = Tree.add t.tree ~key ~data ~compare_key:t.comparator;}
+  let remove t key = {t with tree = Tree.remove t.tree key t.comparator;}
+  let minimum t = try Some (Tree.min_binding t.tree) with Invalid_argument _ -> None
+  let minimum_exn t = Tree.min_binding t.tree
+  let maximum t = try Some (Tree.max_binding t.tree) with Invalid_argument _ -> None
+  let maximum_exn t = Tree.max_binding t.tree
+  let find t key = Tree.search t.tree key t.comparator
+  let find_exn t key =
+    match Tree.search t.tree key t.comparator with
+    | None -> raise Not_found
+    | Some x -> x
+  let mem t key = Tree.exists t.tree key t.comparator
+  let iter t f = Tree.iter t.tree f t.comparator
+  let iteri t f = Tree.iteri t.tree f t.comparator
+  let map t f = {t with tree = Tree.map t.tree f t.comparator}
+  let mapi t f = {t with tree = Tree.mapi t.tree f t.comparator}
+  let fold t ~f ~init = Tree.fold t.tree ~f ~init
+  let compare f t1 t2 = Tree.compare f t1.tree t2.tree t1.comparator
+  let equal f t1 t2 = Tree.equal f t1.tree t2.tree t1.comparator
+  let keys t = []
+  let data t = Tree.data t.tree
+end
+
+type 'k key = 'k
+include Accessor
+
+module type Key = Key
+(* Used by to make key-specified {!Map} module by {!Make} *)
+module type S = S
+  with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
+
+module Make_use_comparator(Key:Comparable.S) = struct
+  module Key = Key
+
+  include Creator (Comparable.S_to_S1(Key))
+  type key = Key.t
+  type ('a, 'b, 'c) map = (Key.t, 'b, Key.comparator) t
+  type 'v t = (Key.t, 'v, Key.comparator) map
+  type 'k key_ = key
+
+  include Accessor
+end
+
+(* Make key-specified module with functor implemented
+   compare between a key and define the type of key
+*)
+module Make(Key:Comparable.Type) = Make_use_comparator(Comparable.Make(Key))
+
+module Poly = struct
+  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
+  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
+  type 'a key = 'a
+
+  (* creator functions *)
+  include Creator (Comparable.Poly)
+  (* accessors *)
+  include Accessor
+
+end
diff --git a/lib/baselib/src/ext_map.mli b/lib/baselib/src/ext_map.mli
index 7988256..8fba58c 100644
--- a/lib/baselib/src/ext_map.mli
+++ b/lib/baselib/src/ext_map.mli
@@ -1,73 +1,73 @@
-(** This module define [Map] module for [Baselib.Std]. I named after {!Ext_map}
-    because don't override Original Caml {!Map} module.
-
-    Internal structure defined this module is based on 'red-black tree',
-    so all operation to defined Map by this module are O(log n) at worst.
-
-    All defined operations has label-interface and first-container arguments that
-    is locate first in operation's arguments.
-
-    Usage:
-
-    1. want map to use Pervasive.compare
-         type map = ('a ,'b) Baselib.Std.Map.Poly.t
-       or
-         module M = Baselib.Std.Map.Poly
-    2. want map with using own comparable module.
-         module M = Baselib.Std.Map.Make(Type)
-    3. want module interface to write for .mli
-         module M : Baselib.Std.Map.S with type Key.t = {b key}
-       in ml,
-         module M = Baselib.Std.Map.Make(struct
-           type t = {b key}
-           let compare = ...
-         end)
-       // Using key you want is as {b key}.
-
-    @author derui
-    @since 0.1
-*)
-
-open Ext_map_intf
-
-(** type for generic map  *)
-type ('k, +'v, 'comparator) t
-type 'k key = 'k
-type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
-
-include Creator with type ('k, 'v, 'comparator) t := ('k, 'v, 'comparator) t
-                and type 'k key := 'k key
-                and type ('a, 'comparator, 'z) create := ('a, 'comparator, 'z) create
-
-include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t
-                 and type 'k key := 'k key
-
-
-module type Key = Key
-(** Used by to make key-specified {!Map} module by {!Make} *)
-module type S = S with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
-
-(** Make key-specified module with functor implemented
-    compare between a key and define the type of key
-*)
-module Make(Key:Key) : S with type Key.t = Key.t
-
-module Make_use_comparator(Key:Comparable.S) : S
-  with type Key.t = Key.t
-  and type Key.comparator = Key.comparator
-
-module Poly : sig
-  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
-  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
-  type ('a, 'b, 'c) t_ = ('a, 'b) t
-  type 'a key = 'a
-  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
-
-  include Creator with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
-                  and type 'a key := 'a key
-                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
-
-  include Accessor with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
-                   and type 'a key := 'a key
-end
-  with type ('a, 'b, 'c) map = ('a, 'b, 'c) t
+(** This module define [Map] module for [Baselib.Std]. I named after {!Ext_map}
+    because don't override Original Caml {!Map} module.
+
+    Internal structure defined this module is based on 'red-black tree',
+    so all operation to defined Map by this module are O(log n) at worst.
+
+    All defined operations has label-interface and first-container arguments that
+    is locate first in operation's arguments.
+
+    Usage:
+
+    1. want map to use Pervasive.compare
+         type map = ('a ,'b) Baselib.Std.Map.Poly.t
+       or
+         module M = Baselib.Std.Map.Poly
+    2. want map with using own comparable module.
+         module M = Baselib.Std.Map.Make(Type)
+    3. want module interface to write for .mli
+         module M : Baselib.Std.Map.S with type Key.t = {b key}
+       in ml,
+         module M = Baselib.Std.Map.Make(struct
+           type t = {b key}
+           let compare = ...
+         end)
+       // Using key you want is as {b key}.
+
+    @author derui
+    @since 0.1
+*)
+
+open Ext_map_intf
+
+(** type for generic map  *)
+type ('k, +'v, 'comparator) t
+type 'k key = 'k
+type ('a, 'comparator, 'z) create = ('a, 'comparator, 'z) create_options_with_comparator
+
+include Creator with type ('k, 'v, 'comparator) t := ('k, 'v, 'comparator) t
+                and type 'k key := 'k key
+                and type ('a, 'comparator, 'z) create := ('a, 'comparator, 'z) create
+
+include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t
+                 and type 'k key := 'k key
+
+
+module type Key = Key
+(** Used by to make key-specified {!Map} module by {!Make} *)
+module type S = S with type ('a, 'b, 'c) map := ('a, 'b, 'c) t
+
+(** Make key-specified module with functor implemented
+    compare between a key and define the type of key
+*)
+module Make(Key:Key) : S with type Key.t = Key.t
+
+module Make_use_comparator(Key:Comparable.S) : S
+  with type Key.t = Key.t
+  and type Key.comparator = Key.comparator
+
+module Poly : sig
+  type ('a, 'b, 'c) map = ('a, 'b, 'c) t
+  type ('a, 'b) t = ('a, 'b, Comparable.Poly.comparator) map
+  type ('a, 'b, 'c) t_ = ('a, 'b) t
+  type 'a key = 'a
+  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
+
+  include Creator with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
+                  and type 'a key := 'a key
+                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
+
+  include Accessor with type ('a, 'b, 'c) t := ('a, 'b, 'c) t_
+                   and type 'a key := 'a key
+end
+  with type ('a, 'b, 'c) map = ('a, 'b, 'c) t
diff --git a/lib/baselib/src/ext_map_intf.ml b/lib/baselib/src/ext_map_intf.ml
index 8744023..e217bb5 100644
--- a/lib/baselib/src/ext_map_intf.ml
+++ b/lib/baselib/src/ext_map_intf.ml
@@ -1,135 +1,135 @@
-(** Define key type and how to compare.
-*)
-module type Key = Comparable.Type
-
-(** Define some operations that are access functions, for instance,
-    add, remove, find, map, iter, and so on.
-
-    This module can use all {!Ext_map} and specialized map created by {!Make} module.
-*)
-module type Accessor = sig
-
-  (** type of key.  *)
-  type 'k key
-  (** type of this map with comparator  *)
-  type ('k, 'v, 'c) t
-
-  (** Return given map is wheter empty or not   *)
-  val is_empty: (_, _, _) t -> bool
-
-  (** Add data to given Map and return to result in added data  *)
-  val add: ('k, 'v, 'c) t -> key:'k key -> data:'v -> ('k, 'v, 'c) t
-
-  (** Remove key and related data from given Map, and return removed Map *)
-  val remove: ('k, 'v, 'c) t -> 'k key -> ('k, 'v, 'c) t
-
-  (** Get minimum key-value pair, if empty Map is given, return None.
-      when use *_exn, raise {!Invalid_argument} if empty tree is given.
-  *)
-  val minimum: ('k, 'v, 'c) t -> ('k key * 'v) option
-  val minimum_exn: ('k, 'v, 'c) t -> 'k key * 'v
-
-  (** Get maximum key-value pair, if empty Map is given, return None.
-      when use *_exn, raise {!Invalid_argument} if empty tree is given.
-  *)
-  val maximum: ('k, 'v, 'c) t -> ('k key * 'v) option
-  val maximum_exn: ('k, 'v, 'c) t -> 'k key * 'v
-
-  (** Search element is related to given key, *_exn raise {!Not_found} if
-      key not found.
-  *)
-  val find: ('k, 'v, 'c) t -> 'k key -> 'v option
-  val find_exn: ('k, 'v, 'c) t -> 'k key -> 'v
-
-  (** Return given key whether contains in container or not *)
-  val mem: ('k, 'v, 'c) t -> 'k key -> bool
-
-  (** Apply function to each associated pair. To use when function have only side-effect.  *)
-  val iter: ('k, 'v, 'c) t -> ('v -> unit) -> unit
-  val iteri: ('k, 'v, 'c) t -> (key:'k key -> data:'v -> unit) -> unit
-
-  (** Apply function to each associated pair, and return new Map consist of result in to apply function. *)
-  val map: ('k, 'v, 'c) t -> ('v -> 'x) -> ('k, 'x, 'c) t
-
-  (** Apply function to each associated pair, and return new Map consist of result in to apply function.
-      Difference of {!Accessor.map} is that key related data add to argument given function.
-  *)
-  val mapi: ('k, 'v, 'c) t -> (key:'k key -> data:'v -> 'x) -> ('k, 'x, 'c) t
-
-  (** Folds over keys and data in map in ascending order.  *)
-  val fold: ('k, 'v, _) t -> f:(key:'k key -> data:'v -> 'a -> 'a) -> init:'a -> 'a
-
-  (** Total ordering between maps. The first argument is a total ordering used to
-      compare data associated with equal keys in the two maps.  *)
-  val compare: ('v -> 'v -> int) -> ('k, 'v, 'c) t -> ('k, 'v, 'c) t -> int
-
-  (** equal cmp m1 m2 tests whether the maps m1 and m2 are equal, that is,
-      contain equal keys and associate them with equal data. cmp is the equality
-      predicate used to compare the data associated with the keys.
-  *)
-  val equal: ('v -> 'v -> bool) -> ('k, 'v, 'c) t -> ('k, 'v, 'c) t -> bool
-
-  (** returns list of keys in map *)
-  val keys: ('k, _, _) t -> 'k key list
-
-  (** returns list of data in map  *)
-  val data: (_, 'v, _) t -> 'v list
-end
-
-(** When create map by {!Creator} with comparator, use {!create_options_with_comparator}.
-    But don't need to use comparator given type parameter,
-    use {!create_options_without_comparator}.
-*)
-type ('a, 'comparator, 'z) create_options_without_comparator = 'z
-type ('a, 'comparator, 'z) create_options_with_comparator =
-    comparator:('a, 'comparator) Comparable.t -> 'z
-
-(** contains some ways to create map. *)
-module type Creator = sig
-
-  (** type of map to create or conversion  *)
-  type 'k key
-  type ('k, 'v, 'comparator) t
-  type ('a, 'comparator, 'z) create
-
-  (** Empty map that is used to initial map for some operations *)
-  val empty : ('a, 'comparator, ('a, _, 'comparator) t) create
-
-  (** map with single pair, value and key  *)
-  val singleton: ('a, 'comparator, 'a key -> 'v -> ('a, 'v, 'comparator) t) create
-
-  (** convert Map to key-value alist.
-      if given map include duplicated key, raise exception
-
-      TODO: Being customizable include duplicate key in map...
-  *)
-  val of_alist: ('a, 'comparator, ('a, 'v, 'comparator) t -> ('a key * 'v) list) create
-end
-
-(** This is signature to make type-specified Map module. *)
-module type S = sig
-  (** module which has type of the key of this module *)
-  module Key : Comparable.S
-
-  (** type of implementation of map *)
-  type ('k, +'v, 'c) map
-  (** type of key specified map  *)
-  type +'v t = (Key.t, 'v, Key.comparator) map
-
-  (** two type variant tied key-specified type  *)
-  type ('k, 'v, 'c) t_ = 'v t
-  (** type for key specified *)
-  type key = Key.t
-  type 'k key_ = key
-  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
-
-  (** inherit {!Accessor} module  *)
-  include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
-                   and type 'k key := 'k key_
-
-  (** inherit {!Creator} module *)
-  include Creator with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
-                  and type 'k key := 'k key_
-                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
-
-end
+(** Define key type and how to compare.
+*)
+module type Key = Comparable.Type
+
+(** Define some operations that are access functions, for instance,
+    add, remove, find, map, iter, and so on.
+
+    This module can use all {!Ext_map} and specialized map created by {!Make} module.
+*)
+module type Accessor = sig
+
+  (** type of key.  *)
+  type 'k key
+  (** type of this map with comparator  *)
+  type ('k, 'v, 'c) t
+
+  (** Return given map is wheter empty or not   *)
+  val is_empty: (_, _, _) t -> bool
+
+  (** Add data to given Map and return to result in added data  *)
+  val add: ('k, 'v, 'c) t -> key:'k key -> data:'v -> ('k, 'v, 'c) t
+
+  (** Remove key and related data from given Map, and return removed Map *)
+  val remove: ('k, 'v, 'c) t -> 'k key -> ('k, 'v, 'c) t
+
+  (** Get minimum key-value pair, if empty Map is given, return None.
+      when use *_exn, raise {!Invalid_argument} if empty tree is given.
+  *)
+  val minimum: ('k, 'v, 'c) t -> ('k key * 'v) option
+  val minimum_exn: ('k, 'v, 'c) t -> 'k key * 'v
+
+  (** Get maximum key-value pair, if empty Map is given, return None.
+      when use *_exn, raise {!Invalid_argument} if empty tree is given.
+  *)
+  val maximum: ('k, 'v, 'c) t -> ('k key * 'v) option
+  val maximum_exn: ('k, 'v, 'c) t -> 'k key * 'v
+
+  (** Search element is related to given key, *_exn raise {!Not_found} if
+      key not found.
+  *)
+  val find: ('k, 'v, 'c) t -> 'k key -> 'v option
+  val find_exn: ('k, 'v, 'c) t -> 'k key -> 'v
+
+  (** Return given key whether contains in container or not *)
+  val mem: ('k, 'v, 'c) t -> 'k key -> bool
+
+  (** Apply function to each associated pair. To use when function have only side-effect.  *)
+  val iter: ('k, 'v, 'c) t -> ('v -> unit) -> unit
+  val iteri: ('k, 'v, 'c) t -> (key:'k key -> data:'v -> unit) -> unit
+
+  (** Apply function to each associated pair, and return new Map consist of result in to apply function. *)
+  val map: ('k, 'v, 'c) t -> ('v -> 'x) -> ('k, 'x, 'c) t
+
+  (** Apply function to each associated pair, and return new Map consist of result in to apply function.
+      Difference of {!Accessor.map} is that key related data add to argument given function.
+  *)
+  val mapi: ('k, 'v, 'c) t -> (key:'k key -> data:'v -> 'x) -> ('k, 'x, 'c) t
+
+  (** Folds over keys and data in map in ascending order.  *)
+  val fold: ('k, 'v, _) t -> f:(key:'k key -> data:'v -> 'a -> 'a) -> init:'a -> 'a
+
+  (** Total ordering between maps. The first argument is a total ordering used to
+      compare data associated with equal keys in the two maps.  *)
+  val compare: ('v -> 'v -> int) -> ('k, 'v, 'c) t -> ('k, 'v, 'c) t -> int
+
+  (** equal cmp m1 m2 tests whether the maps m1 and m2 are equal, that is,
+      contain equal keys and associate them with equal data. cmp is the equality
+      predicate used to compare the data associated with the keys.
+  *)
+  val equal: ('v -> 'v -> bool) -> ('k, 'v, 'c) t -> ('k, 'v, 'c) t -> bool
+
+  (** returns list of keys in map *)
+  val keys: ('k, _, _) t -> 'k key list
+
+  (** returns list of data in map  *)
+  val data: (_, 'v, _) t -> 'v list
+end
+
+(** When create map by {!Creator} with comparator, use {!create_options_with_comparator}.
+    But don't need to use comparator given type parameter,
+    use {!create_options_without_comparator}.
+*)
+type ('a, 'comparator, 'z) create_options_without_comparator = 'z
+type ('a, 'comparator, 'z) create_options_with_comparator =
+    comparator:('a, 'comparator) Comparable.t -> 'z
+
+(** contains some ways to create map. *)
+module type Creator = sig
+
+  (** type of map to create or conversion  *)
+  type 'k key
+  type ('k, 'v, 'comparator) t
+  type ('a, 'comparator, 'z) create
+
+  (** Empty map that is used to initial map for some operations *)
+  val empty : ('a, 'comparator, ('a, _, 'comparator) t) create
+
+  (** map with single pair, value and key  *)
+  val singleton: ('a, 'comparator, 'a key -> 'v -> ('a, 'v, 'comparator) t) create
+
+  (** convert Map to key-value alist.
+      if given map include duplicated key, raise exception
+
+      TODO: Being customizable include duplicate key in map...
+  *)
+  val of_alist: ('a, 'comparator, ('a, 'v, 'comparator) t -> ('a key * 'v) list) create
+end
+
+(** This is signature to make type-specified Map module. *)
+module type S = sig
+  (** module which has type of the key of this module *)
+  module Key : Comparable.S
+
+  (** type of implementation of map *)
+  type ('k, +'v, 'c) map
+  (** type of key specified map  *)
+  type +'v t = (Key.t, 'v, Key.comparator) map
+
+  (** two type variant tied key-specified type  *)
+  type ('k, 'v, 'c) t_ = 'v t
+  (** type for key specified *)
+  type key = Key.t
+  type 'k key_ = key
+  type ('a, 'b, 'c) create = ('a, 'b, 'c) create_options_without_comparator
+
+  (** inherit {!Accessor} module  *)
+  include Accessor with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
+                   and type 'k key := 'k key_
+
+  (** inherit {!Creator} module *)
+  include Creator with type ('k, 'v, 'c) t := ('k, 'v, 'c) t_
+                  and type 'k key := 'k key_
+                  and type ('a, 'b, 'c) create := ('a, 'b, 'c) create
+
+end
diff --git a/lib/baselib/src/float.ml b/lib/baselib/src/float.ml
index d3825a2..ce53cd6 100644
--- a/lib/baselib/src/float.ml
+++ b/lib/baselib/src/float.ml
@@ -1,7 +1,7 @@
-open Prelude
-
-let compare ?(epsilon=0.00001) f1 f2 =
-  let diff = f1 -. f2 |> abs_float in
-  if diff < epsilon then 0
-  else if f1 < f2 then -1
-  else 1
+open Prelude
+
+let compare ?(epsilon=0.00001) f1 f2 =
+  let diff = f1 -. f2 |> abs_float in
+  if diff < epsilon then 0
+  else if f1 < f2 then -1
+  else 1
diff --git a/lib/baselib/src/float.mli b/lib/baselib/src/float.mli
index f7b264c..1730436 100644
--- a/lib/baselib/src/float.mli
+++ b/lib/baselib/src/float.mli
@@ -1,17 +1,17 @@
-(**
-   Provide some functions for operation with float.
-
-   @author derui
-   @version 0.1
-*)
-
-(** Compare two float. Argument epsilon is maximum difference with two float
-    allowed to equal to two float.
-    The default value of epsilon is 0.000001, then you specify epsilon if you need more or less accuracy.
-
-    @param f1 a float to compare with another float
-    @param f2 a float to compare with another float
-    @param epsilon maximum difference between two float to be allowed equivalent
-    @return -1 if f1 is less than f2, 1 if f1 is greater than f2, 0 if f1 equal to f2
-*)
-val compare : ?epsilon:float -> float -> float -> int
+(**
+   Provide some functions for operation with float.
+
+   @author derui
+   @version 0.1
+*)
+
+(** Compare two float. Argument epsilon is maximum difference with two float
+    allowed to equal to two float.
+    The default value of epsilon is 0.000001, then you specify epsilon if you need more or less accuracy.
+
+    @param f1 a float to compare with another float
+    @param f2 a float to compare with another float
+    @param epsilon maximum difference between two float to be allowed equivalent
+    @return -1 if f1 is less than f2, 1 if f1 is greater than f2, 0 if f1 equal to f2
+*)
+val compare : ?epsilon:float -> float -> float -> int
diff --git a/lib/baselib/src/input_channel.ml b/lib/baselib/src/input_channel.ml
index cb463f3..eb0a766 100644
--- a/lib/baselib/src/input_channel.ml
+++ b/lib/baselib/src/input_channel.ml
@@ -1,20 +1,20 @@
-let read ~chan ~len =
-  let buffer = String.create len in
-  try
-    really_input chan buffer 0 len;
-    Some buffer
-  with End_of_file -> None
-
-
-let seek chan ~from ~pos =
-  match from with
-  | `Current -> seek_in chan ((pos_in chan) + pos)
-  | `Head -> seek_in chan pos
-  | `Tail -> seek_in chan ((in_channel_length chan) - pos)
-
-let ahead chan len =
-  let open Option.Open in
-  read ~chan ~len >>= (fun buf ->
-    seek chan ~from:`Current ~pos:(-len);
-    return buf
-  )
+let read ~chan ~len =
+  let buffer = String.create len in
+  try
+    really_input chan buffer 0 len;
+    Some buffer
+  with End_of_file -> None
+
+
+let seek chan ~from ~pos =
+  match from with
+  | `Current -> seek_in chan ((pos_in chan) + pos)
+  | `Head -> seek_in chan pos
+  | `Tail -> seek_in chan ((in_channel_length chan) - pos)
+
+let ahead chan len =
+  let open Option.Open in
+  read ~chan ~len >>= (fun buf ->
+    seek chan ~from:`Current ~pos:(-len);
+    return buf
+  )
diff --git a/lib/baselib/src/input_channel.mli b/lib/baselib/src/input_channel.mli
index b7ddba6..0fa8233 100644
--- a/lib/baselib/src/input_channel.mli
+++ b/lib/baselib/src/input_channel.mli
@@ -1,40 +1,40 @@
-(** Implements functions for input channel as extended Pervasive's.
-    Provided functions are able to split some categories, such as
-    binary, text, and useful input funcitons.
-
-    @author derui
-    @version 0.2
-*)
-
-(** Read exactly len charactors from current position of the input channel.
-    If in_channel reached end of file, return None.
-
-    @param chan input channel to read charactors
-    @param len reading length from input channel
-    @return readed charactors
-*)
-val read : chan:in_channel -> len:int -> string option
-
-(** This sets the current reading position to pos for channel chan.
-    You can select some methods to detect setting the current reading position as follows:
-    `Current -> Set the current reading position to add pos to the current reading position.
-    `Head -> Set the current reading position to set it to directly pos.
-    `Tail -> Set the current reading position to subtract pos to the tail of channel chan.
-
-    Note: You must set negative value to pos if `Tail selected.
-
-    @param in_channel the input channel to set the current reading position to pos for.
-    @param from the method to detect start position for setting the current reading position.
-    @param pos the position to set the current reading position to.
-*)
-val seek : in_channel -> from:[< `Current | `Head | `Tail]
-  -> pos:int -> unit
-
-(** Read exactly len charactors from the current reading position of the channel chan,
-    and rewind the channel chan to head of it.
-
-    @param chan input channel to read charactors
-    @param len reading length from input channel
-    @return readed charactors
-*)
-val ahead : in_channel -> int -> string option
+(** Implements functions for input channel as extended Pervasive's.
+    Provided functions are able to split some categories, such as
+    binary, text, and useful input funcitons.
+
+    @author derui
+    @version 0.2
+*)
+
+(** Read exactly len charactors from current position of the input channel.
+    If in_channel reached end of file, return None.
+
+    @param chan input channel to read charactors
+    @param len reading length from input channel
+    @return readed charactors
+*)
+val read : chan:in_channel -> len:int -> string option
+
+(** This sets the current reading position to pos for channel chan.
+    You can select some methods to detect setting the current reading position as follows:
+    `Current -> Set the current reading position to add pos to the current reading position.
+    `Head -> Set the current reading position to set it to directly pos.
+    `Tail -> Set the current reading position to subtract pos to the tail of channel chan.
+
+    Note: You must set negative value to pos if `Tail selected.
+
+    @param in_channel the input channel to set the current reading position to pos for.
+    @param from the method to detect start position for setting the current reading position.
+    @param pos the position to set the current reading position to.
+*)
+val seek : in_channel -> from:[< `Current | `Head | `Tail]
+  -> pos:int -> unit
+
+(** Read exactly len charactors from the current reading position of the channel chan,
+    and rewind the channel chan to head of it.
+
+    @param chan input channel to read charactors
+    @param len reading length from input channel
+    @return readed charactors
+*)
+val ahead : in_channel -> int -> string option
diff --git a/lib/baselib/src/math.ml b/lib/baselib/src/math.ml
index 26b54a8..f490190 100644
--- a/lib/baselib/src/math.ml
+++ b/lib/baselib/src/math.ml
@@ -1,6 +1,6 @@
-
-(* constant value of pi. *)
-let pi = acos (-1.0)
-
-let rad_to_deg rad = rad *. (pi /. 180.0)
-let deg_to_rad deg = deg *. (180.0 /. pi)
+
+(* constant value of pi. *)
+let pi = acos (-1.0)
+
+let rad_to_deg rad = rad *. (pi /. 180.0)
+let deg_to_rad deg = deg *. (180.0 /. pi)
diff --git a/lib/baselib/src/math.mli b/lib/baselib/src/math.mli
index 6c6c817..ba48c72 100644
--- a/lib/baselib/src/math.mli
+++ b/lib/baselib/src/math.mli
@@ -1,8 +1,8 @@
-
-(** constant value of pi. *)
-val pi : float
-
-(** conversion radian and degree. *)
-val rad_to_deg : float -> float
-(** see `rad_to_deg` *)
-val deg_to_rad : float -> float
+
+(** constant value of pi. *)
+val pi : float
+
+(** conversion radian and degree. *)
+val rad_to_deg : float -> float
+(** see `rad_to_deg` *)
+val deg_to_rad : float -> float
diff --git a/lib/baselib/src/monad.ml b/lib/baselib/src/monad.ml
index 358fd2b..9b863a3 100644
--- a/lib/baselib/src/monad.ml
+++ b/lib/baselib/src/monad.ml
@@ -1,51 +1,51 @@
-open Monad_intf
-
-module Make (T:Type) : S with type 'a t := 'a T.t =
-struct
-  include T
-
-  module Open_ = struct
-    let bind = T.bind
-    let (>>=) = T.bind
-    let return = T.return
-  end
-  include Open_
-  module Open = struct
-    type 'a t = 'a T.t
-    include Open_
-  end
-
-  let map f m = m >>= fun m -> return (f m)
-
-  let rec sequence = function
-    | [] -> return []
-    | x::xs ->
-      x >>= fun x ->
-      sequence xs >>= fun xs ->
-      return (x::xs)
-end
-
-module Make2 (T:Type2) : S2 with type ('a, 'z) t := ('a, 'z) T.t =
-struct
-
-  include T
-  module Open_ = struct
-    let bind = T.bind
-    let (>>=) = T.bind
-    let return = T.return
-  end
-  include Open_
-  module Open = struct
-    type ('a, 'z) t = ('a, 'z) T.t
-    include Open_
-  end
-
-  let map f m = m >>= fun m -> return (f m)
-
-  let rec sequence = function
-    | [] -> return []
-    | x::xs ->
-      x >>= fun x ->
-      sequence xs >>= fun xs ->
-      return (x::xs)
-end
+open Monad_intf
+
+module Make (T:Type) : S with type 'a t := 'a T.t =
+struct
+  include T
+
+  module Open_ = struct
+    let bind = T.bind
+    let (>>=) = T.bind
+    let return = T.return
+  end
+  include Open_
+  module Open = struct
+    type 'a t = 'a T.t
+    include Open_
+  end
+
+  let map f m = m >>= fun m -> return (f m)
+
+  let rec sequence = function
+    | [] -> return []
+    | x::xs ->
+      x >>= fun x ->
+      sequence xs >>= fun xs ->
+      return (x::xs)
+end
+
+module Make2 (T:Type2) : S2 with type ('a, 'z) t := ('a, 'z) T.t =
+struct
+
+  include T
+  module Open_ = struct
+    let bind = T.bind
+    let (>>=) = T.bind
+    let return = T.return
+  end
+  include Open_
+  module Open = struct
+    type ('a, 'z) t = ('a, 'z) T.t
+    include Open_
+  end
+
+  let map f m = m >>= fun m -> return (f m)
+
+  let rec sequence = function
+    | [] -> return []
+    | x::xs ->
+      x >>= fun x ->
+      sequence xs >>= fun xs ->
+      return (x::xs)
+end
diff --git a/lib/baselib/src/monad.mli b/lib/baselib/src/monad.mli
index f8eba10..67df629 100644
--- a/lib/baselib/src/monad.mli
+++ b/lib/baselib/src/monad.mli
@@ -1,12 +1,12 @@
-open Monad_intf
-
-(**
-   Make module-specific module of T with module-specific module
-   implemented of Type.
-
-   If you need binary operator to use without module-prefix, call
-   X.Open. (X is your module maked by this functor)
-   X.Open extract only binary operators. other functions are not extracted.
-*)
-module Make (A : Type) : S with type 'a t := 'a A.t
-module Make2 (A : Type2) : S2 with type ('a, 'z) t := ('a, 'z) A.t
+open Monad_intf
+
+(**
+   Make module-specific module of T with module-specific module
+   implemented of Type.
+
+   If you need binary operator to use without module-prefix, call
+   X.Open. (X is your module maked by this functor)
+   X.Open extract only binary operators. other functions are not extracted.
+*)
+module Make (A : Type) : S with type 'a t := 'a A.t
+module Make2 (A : Type2) : S2 with type ('a, 'z) t := ('a, 'z) A.t
diff --git a/lib/baselib/src/monad_intf.ml b/lib/baselib/src/monad_intf.ml
index a69ff67..8c6f83a 100644
--- a/lib/baselib/src/monad_intf.ml
+++ b/lib/baselib/src/monad_intf.ml
@@ -1,105 +1,105 @@
-(**
-   Basic interface for module convert to monadic module.
-   Implementation along this interface for module is user responsibility.
-*)
-module type Type = sig
-  (** type of monadic module.
-      Have only one type variant type.
-  *)
-  type +'a t
-
-  (** Return wrapped value as monad. *)
-  val return : 'a -> 'a t
-
-  (** binding monad with function, and return new monad having other type. *)
-  val bind : 'a t -> ('a -> 'b t) -> 'b t
-end
-
-(** Integrating module for binary operators.
-    All binary operators containing this module are contained of
-    {!S} module in the same way.
-*)
-module type Open = sig
-  type +'a t
-
-  (** Synonym for bind *)
-  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
-
-  val return : 'a -> 'a t
-
-  val bind : 'a t -> ('a -> 'b t) -> 'b t
-end
-
-(**
-   Additional to more function using basic function provided from
-   Type.
-   This module have implementation, so you don't need to implement this.
-*)
-module type S = sig
-
-  include Open
-  module Open : Open with type 'a t = 'a t
-
-  (** alias {!bind} on {!Type} *)
-  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
-
-  (** given unmonadic function apply to monad.
-      So-called `lift' other instruction.
-  *)
-  val map : ('a -> 'b) -> 'a t -> 'b t
-
-  (** Return monadic list that consist of getting value from each
-      monad *)
-  val sequence : 'a t list -> 'a list t
-end
-
-(**
-   Basic interface for module convert to monadic module.
-   Modules that have -2 suffix in module name affects
-   [only first type variant], be careful!
-
-   Implementation along this interface for module is user responsibility.
-*)
-module type Type2 = sig
-  (** type of monadic module for having 2 type variant.
-  *)
-  type ('a, 'z) t
-
-  (** Return wrapped value as monad. *)
-  val return : 'a -> ('a, 'z) t
-
-  (** binding monad with function, and return new monad having other type. *)
-  val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
-end
-
-(** Integrating module for binary operators.
-    All binary operators containing this module are contained of
-    {!S2} module in the same way.
-*)
-module type Open2 = sig
-  type ('a, 'z) t
-  (** synonym for bind *)
-  val (>>=) : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
-  val return : 'a -> ('a, 'z) t
-
-  val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
-end
-
-(**
-   Additional to more function using basic function provided from
-   Type.
-   This module have implementation, so you don't need to implement this.
-*)
-module type S2 = sig
-  include Open2
-  module Open : Open2 with type ('a, 'z) t = ('a, 'z) t
-
-  (** given unmonadic function apply to monad.
-      So-called `lift' other instruction.
-  *)
-  val map : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t
-
-  (** Return monadic list that consist of getting value from each
-      monad *)
-  val sequence : ('a, 'z) t list -> ('a list, 'z) t
-end
+(**
+   Basic interface for module convert to monadic module.
+   Implementation along this interface for module is user responsibility.
+*)
+module type Type = sig
+  (** type of monadic module.
+      Have only one type variant type.
+  *)
+  type +'a t
+
+  (** Return wrapped value as monad. *)
+  val return : 'a -> 'a t
+
+  (** binding monad with function, and return new monad having other type. *)
+  val bind : 'a t -> ('a -> 'b t) -> 'b t
+end
+
+(** Integrating module for binary operators.
+    All binary operators containing this module are contained of
+    {!S} module in the same way.
+*)
+module type Open = sig
+  type +'a t
+
+  (** Synonym for bind *)
+  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
+
+  val return : 'a -> 'a t
+
+  val bind : 'a t -> ('a -> 'b t) -> 'b t
+end
+
+(**
+   Additional to more function using basic function provided from
+   Type.
+   This module have implementation, so you don't need to implement this.
+*)
+module type S = sig
+
+  include Open
+  module Open : Open with type 'a t = 'a t
+
+  (** alias {!bind} on {!Type} *)
+  val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
+
+  (** given unmonadic function apply to monad.
+      So-called `lift' other instruction.
+  *)
+  val map : ('a -> 'b) -> 'a t -> 'b t
+
+  (** Return monadic list that consist of getting value from each
+      monad *)
+  val sequence : 'a t list -> 'a list t
+end
+
+(**
+   Basic interface for module convert to monadic module.
+   Modules that have -2 suffix in module name affects
+   [only first type variant], be careful!
+
+   Implementation along this interface for module is user responsibility.
+*)
+module type Type2 = sig
+  (** type of monadic module for having 2 type variant.
+  *)
+  type ('a, 'z) t
+
+  (** Return wrapped value as monad. *)
+  val return : 'a -> ('a, 'z) t
+
+  (** binding monad with function, and return new monad having other type. *)
+  val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
+end
+
+(** Integrating module for binary operators.
+    All binary operators containing this module are contained of
+    {!S2} module in the same way.
+*)
+module type Open2 = sig
+  type ('a, 'z) t
+  (** synonym for bind *)
+  val (>>=) : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
+  val return : 'a -> ('a, 'z) t
+
+  val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
+end
+
+(**
+   Additional to more function using basic function provided from
+   Type.
+   This module have implementation, so you don't need to implement this.
+*)
+module type S2 = sig
+  include Open2
+  module Open : Open2 with type ('a, 'z) t = ('a, 'z) t
+
+  (** given unmonadic function apply to monad.
+      So-called `lift' other instruction.
+  *)
+  val map : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t
+
+  (** Return monadic list that consist of getting value from each
+      monad *)
+  val sequence : ('a, 'z) t list -> ('a list, 'z) t
+end
diff --git a/lib/baselib/src/option.ml b/lib/baselib/src/option.ml
index 235d995..ba225b7 100644
--- a/lib/baselib/src/option.ml
+++ b/lib/baselib/src/option.ml
@@ -1,58 +1,58 @@
-let to_string_sep rparen lparen f = function
-  | None -> rparen ^ lparen
-  | Some x -> rparen ^ (f x) ^ lparen
-
-let to_string f = to_string_sep "{" "}" f
-
-let print fmt f x = Format.fprintf fmt "%s" (to_string f x)
-
-let is_none = function
-  | None -> true
-  | _ -> false
-
-let is_some = function
-  | Some _ -> true
-  | _ -> false
-
-let compare_with ?(comparator=compare) fst snd =
-  match (fst, snd) with
-  | None, None -> 0
-  | Some _, None -> 1
-  | None , Some _ -> -1
-  | Some x, Some y -> comparator x y
-
-let map f list =
-  let rec map_ f list build =
-    match list with
-    | [] -> build
-    | Some (x) :: rest -> map_ f rest (f x :: build)
-    | None :: rest -> map_ f rest build in
-  map_ f list []
-
-module Core =
-struct
-  type 'a t = 'a option
-  let empty = None
-  let identity = None
-  let return x = Some x
-  let some = return
-  let add x _ = Some x
-
-  let bind x f =
-    match x with
-    | None -> None
-    | Some x -> f x
-
-  let fold f x e =
-    match x with
-    | None -> e
-    | Some x -> f x e
-
-  let safe_get e = function
-    |  None -> e
-    | Some x -> x
-end
-
-include Core
-include Monad.Make(Core)
-include TypedCollection.Make(Core)
+let to_string_sep rparen lparen f = function
+  | None -> rparen ^ lparen
+  | Some x -> rparen ^ (f x) ^ lparen
+
+let to_string f = to_string_sep "{" "}" f
+
+let print fmt f x = Format.fprintf fmt "%s" (to_string f x)
+
+let is_none = function
+  | None -> true
+  | _ -> false
+
+let is_some = function
+  | Some _ -> true
+  | _ -> false
+
+let compare_with ?(comparator=compare) fst snd =
+  match (fst, snd) with
+  | None, None -> 0
+  | Some _, None -> 1
+  | None , Some _ -> -1
+  | Some x, Some y -> comparator x y
+
+let map f list =
+  let rec map_ f list build =
+    match list with
+    | [] -> build
+    | Some (x) :: rest -> map_ f rest (f x :: build)
+    | None :: rest -> map_ f rest build in
+  map_ f list []
+
+module Core =
+struct
+  type 'a t = 'a option
+  let empty = None
+  let identity = None
+  let return x = Some x
+  let some = return
+  let add x _ = Some x
+
+  let bind x f =
+    match x with
+    | None -> None
+    | Some x -> f x
+
+  let fold f x e =
+    match x with
+    | None -> e
+    | Some x -> f x e
+
+  let safe_get e = function
+    |  None -> e
+    | Some x -> x
+end
+
+include Core
+include Monad.Make(Core)
+include TypedCollection.Make(Core)
diff --git a/lib/baselib/src/option.mli b/lib/baselib/src/option.mli
index 97dc882..5f268ba 100644
--- a/lib/baselib/src/option.mli
+++ b/lib/baselib/src/option.mli
@@ -1,65 +1,65 @@
-(**
-   Add some functions for predefined {!option}.
-   this module provide below modules for 'a option.
-
-   - Monad
-   - TypedCollection
-
-   Use Make functor if you need type-specific option.
-   But, have remaks of specifiied module made by Make,
-   it can't use as Monad, so if need monadic Option, you use no
-   specified option, that is this module, which is solo access.
-*)
-
-(** Convert Option to string with translating function. *)
-val to_string : ('a -> string) -> 'a option -> string
-
-(** output string that converted option. *)
-val print : Format.formatter -> ('a -> string) -> 'a option -> unit
-
-(** return true if given option is None. *)
-val is_none : 'a option -> bool
-
-(** return true if given option is Some and some value. *)
-val is_some : 'a option -> bool
-
-(** Compared to between two options with comparator for
-    between type variant of type.
-
-    Comparing resulted by this function are as follows:
-
-    | fst  | snd    | result
-    | -----+--------+--------
-    | None | None   |   0
-    | Some | None   |   1
-    | None | Some   |  -1
-    | Some | Some   | depend on comparator
-
-    comparator result are expected to equal {!Pervasive.compare}.
-    @param comparator compared to between any type value. default is {!Pervasive.compare}
-    @param first A option value
-    @param second A option value
-    @return -1 is lesser than, 1 is greater than, to equal 1
-*)
-val compare_with : ?comparator:('a -> 'a -> int) -> 'a option -> 'a option -> int
-
-(** this function applies given function to each element of list,
-    and builds the list with the results returned by given function.
-    But, appling given function only target Some variant. None is ignored.
-*)
-val map : ('a -> 'b) -> 'a option list -> 'b list
-
-(**
-   Provide monadic operation with 'a option.
-
-   Monadic option behaved under {!Monad.Type} functions are following:
-
-   | return : Wraping given argument to Some.
-   | bind   : If given monad is None, chain of bindings finish on the
-   |          spot, and return None.
-   |          Otherwise it apply function and return result of
-   |          function wrapped Some
-*)
-include Monad_intf.S with type 'a t := 'a option
-include TypedCollection.Type with type 'a t := 'a option
-include TypedCollection.S with type 'a t := 'a option
+(**
+   Add some functions for predefined {!option}.
+   this module provide below modules for 'a option.
+
+   - Monad
+   - TypedCollection
+
+   Use Make functor if you need type-specific option.
+   But, have remaks of specifiied module made by Make,
+   it can't use as Monad, so if need monadic Option, you use no
+   specified option, that is this module, which is solo access.
+*)
+
+(** Convert Option to string with translating function. *)
+val to_string : ('a -> string) -> 'a option -> string
+
+(** output string that converted option. *)
+val print : Format.formatter -> ('a -> string) -> 'a option -> unit
+
+(** return true if given option is None. *)
+val is_none : 'a option -> bool
+
+(** return true if given option is Some and some value. *)
+val is_some : 'a option -> bool
+
+(** Compared to between two options with comparator for
+    between type variant of type.
+
+    Comparing resulted by this function are as follows:
+
+    | fst  | snd    | result
+    | -----+--------+--------
+    | None | None   |   0
+    | Some | None   |   1
+    | None | Some   |  -1
+    | Some | Some   | depend on comparator
+
+    comparator result are expected to equal {!Pervasive.compare}.
+    @param comparator compared to between any type value. default is {!Pervasive.compare}
+    @param first A option value
+    @param second A option value
+    @return -1 is lesser than, 1 is greater than, to equal 1
+*)
+val compare_with : ?comparator:('a -> 'a -> int) -> 'a option -> 'a option -> int
+
+(** this function applies given function to each element of list,
+    and builds the list with the results returned by given function.
+    But, appling given function only target Some variant. None is ignored.
+*)
+val map : ('a -> 'b) -> 'a option list -> 'b list
+
+(**
+   Provide monadic operation with 'a option.
+
+   Monadic option behaved under {!Monad.Type} functions are following:
+
+   | return : Wraping given argument to Some.
+   | bind   : If given monad is None, chain of bindings finish on the
+   |          spot, and return None.
+   |          Otherwise it apply function and return result of
+   |          function wrapped Some
+*)
+include Monad_intf.S with type 'a t := 'a option
+include TypedCollection.Type with type 'a t := 'a option
+include TypedCollection.S with type 'a t := 'a option
diff --git a/lib/baselib/src/prelude.ml b/lib/baselib/src/prelude.ml
index dc7876f..13d1312 100644
--- a/lib/baselib/src/prelude.ml
+++ b/lib/baselib/src/prelude.ml
@@ -1,21 +1,21 @@
-open Num
-
-(* identity function *)
-let id t = t
-let const x _ = x
-let flip f x y = f y x
-
-let (|>) f g = g f
-let (|<) f g = f g
-let (@<) f g = (fun x -> f (g x))
-let (@>) f g = (fun x -> g (f x))
-
-let cmp_float ~epsilon f1 f2 =
-  let sub = (f1 -. f2) in
-  let sub_abs = abs_float sub in
-  if sub_abs <= epsilon then 0
-  else if sub < 0.0 then -1
-  else 1
-
-let curry f a b = f (a, b)
-let uncurry f (a, b) = f a b
+open Num
+
+(* identity function *)
+let id t = t
+let const x _ = x
+let flip f x y = f y x
+
+let (|>) f g = g f
+let (|<) f g = f g
+let (@<) f g = (fun x -> f (g x))
+let (@>) f g = (fun x -> g (f x))
+
+let cmp_float ~epsilon f1 f2 =
+  let sub = (f1 -. f2) in
+  let sub_abs = abs_float sub in
+  if sub_abs <= epsilon then 0
+  else if sub < 0.0 then -1
+  else 1
+
+let curry f a b = f (a, b)
+let uncurry f (a, b) = f a b
diff --git a/lib/baselib/src/prelude.mli b/lib/baselib/src/prelude.mli
index 38380c8..b8e4cf8 100644
--- a/lib/baselib/src/prelude.mli
+++ b/lib/baselib/src/prelude.mli
@@ -1,41 +1,41 @@
-(**
-   The Prelude module.
-
-   Some useful and basically functions contained this module.
-   All functions doesn't belong any module, are used to some situation
-   as utility.
-*)
-
-(** identity function *)
-val id : 'a -> 'a
-(** constant function. always return first argument. *)
-val const : 'a -> 'b -> 'a
-(** flip argument align. *)
-val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
-
-(** control direction of to apply function to argument.
-   |> looks like monad bind (>>=) is reversed to apply argument of
-   normal direction.
-*)
-val (|>) : 'a -> ('a -> 'b ) -> 'b
-
-(** control direction of to apply function to argument.
-   |< is alias of normal function application.
-*)
-val (|<) : ('a -> 'b) -> 'a -> 'b
-
-(** Combine two functions like from haskell's *)
-val (@<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
-(** Combine two functions which direction to apply is forward *)
-val (@>) : ('a -> 'b)  -> ('b -> 'c) -> 'a -> 'c
-
-
-(** comparing floats that if one float has difference lesser than
-  `epsilon`, result of comparing is `0` as true.
-*)
-val cmp_float : epsilon:float -> float -> float -> int
-
-(** curry converts an uncurried function to a curried function *)
-val curry: ('a * 'b -> 'c) -> 'a -> 'b -> 'c
-(** convertes an curried function to an uncirried function *)
-val uncurry: ('a -> 'b -> 'c) -> 'a * 'b -> 'c
+(**
+   The Prelude module.
+
+   Some useful and basically functions contained this module.
+   All functions doesn't belong any module, are used to some situation
+   as utility.
+*)
+
+(** identity function *)
+val id : 'a -> 'a
+(** constant function. always return first argument. *)
+val const : 'a -> 'b -> 'a
+(** flip argument align. *)
+val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
+
+(** control direction of to apply function to argument.
+   |> looks like monad bind (>>=) is reversed to apply argument of
+   normal direction.
+*)
+val (|>) : 'a -> ('a -> 'b ) -> 'b
+
+(** control direction of to apply function to argument.
+   |< is alias of normal function application.
+*)
+val (|<) : ('a -> 'b) -> 'a -> 'b
+
+(** Combine two functions like from haskell's *)
+val (@<) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c
+(** Combine two functions which direction to apply is forward *)
+val (@>) : ('a -> 'b)  -> ('b -> 'c) -> 'a -> 'c
+
+
+(** comparing floats that if one float has difference lesser than
+  `epsilon`, result of comparing is `0` as true.
+*)
+val cmp_float : epsilon:float -> float -> float -> int
+
+(** curry converts an uncurried function to a curried function *)
+val curry: ('a * 'b -> 'c) -> 'a -> 'b -> 'c
+(** convertes an curried function to an uncirried function *)
+val uncurry: ('a -> 'b -> 'c) -> 'a * 'b -> 'c
diff --git a/lib/baselib/src/std.ml b/lib/baselib/src/std.ml
index 0c877b6..4d52231 100644
--- a/lib/baselib/src/std.ml
+++ b/lib/baselib/src/std.ml
@@ -1,37 +1,37 @@
-module Collection = Collection
-module CompareStringable = CompareStringable
-module Math = Math
-module Monad = Monad
-module Option = Option
-module Prelude = Prelude
-module Stringable = Stringable
-module TypedCollection = TypedCollection
-module TypedStringable = TypedStringable
-module Binary_pack = Binary_pack
-module Input_channel = Input_channel
-
-module Either = Either
-
-module Comparable = Comparable
-
-(* extended List *)
-module List = struct
-  (* Inherits the original List module *)
-  include List
-
-  (* Inherits my extended List *)
-  include Ext_list
-end
-
-module Array = struct
-  (* Inherits the original Array module *)
-  include Array
-
-  (* Inherits my extended Array *)
-  include Ext_array
-end
-
-(* Original Map module *)
-module Map = Ext_map
-
-module Float = Float
+module Collection = Collection
+module CompareStringable = CompareStringable
+module Math = Math
+module Monad = Monad
+module Option = Option
+module Prelude = Prelude
+module Stringable = Stringable
+module TypedCollection = TypedCollection
+module TypedStringable = TypedStringable
+module Binary_pack = Binary_pack
+module Input_channel = Input_channel
+
+module Either = Either
+
+module Comparable = Comparable
+
+(* extended List *)
+module List = struct
+  (* Inherits the original List module *)
+  include List
+
+  (* Inherits my extended List *)
+  include Ext_list
+end
+
+module Array = struct
+  (* Inherits the original Array module *)
+  include Array
+
+  (* Inherits my extended Array *)
+  include Ext_array
+end
+
+(* Original Map module *)
+module Map = Ext_map
+
+module Float = Float
diff --git a/lib/baselib/src/stringable.ml b/lib/baselib/src/stringable.ml
index b499727..02247cd 100644
--- a/lib/baselib/src/stringable.ml
+++ b/lib/baselib/src/stringable.ml
@@ -1,28 +1,28 @@
-
-module type Type =
-sig
-  type t
-  val to_string : t -> string
-end
-
-module type S =
-sig
-  type t
-  val print : Format.formatter -> t -> unit
-  val to_chararray : t -> char array
-  val to_charlist : t -> char list
-end
-
-module Make (T : Type) : S with type t := T.t =
-struct
-  open T
-
-  let print fmt t = Format.fprintf fmt "%s" (to_string t)
-
-  let to_chararray t =
-    let s = to_string t in
-    Array.init (String.length s) (String.get s)
-
-  let to_charlist t =
-    Array.to_list (to_chararray t)
-end
+
+module type Type =
+sig
+  type t
+  val to_string : t -> string
+end
+
+module type S =
+sig
+  type t
+  val print : Format.formatter -> t -> unit
+  val to_chararray : t -> char array
+  val to_charlist : t -> char list
+end
+
+module Make (T : Type) : S with type t := T.t =
+struct
+  open T
+
+  let print fmt t = Format.fprintf fmt "%s" (to_string t)
+
+  let to_chararray t =
+    let s = to_string t in
+    Array.init (String.length s) (String.get s)
+
+  let to_charlist t =
+    Array.to_list (to_chararray t)
+end
diff --git a/lib/baselib/src/stringable.mli b/lib/baselib/src/stringable.mli
index a7a27c4..bd0aad2 100644
--- a/lib/baselib/src/stringable.mli
+++ b/lib/baselib/src/stringable.mli
@@ -1,22 +1,22 @@
-(* Stringable Type. *)
-module type Type =
-sig
-  type t
-  (* translate t into string. *)
-  val to_string : t -> string
-end
-
-(* Signature of Stringable. *)
-module type S =
-sig
-  type t
-  (* printing type with Format.fomatter. *)
-  val print : Format.formatter -> t -> unit
-  (* type convert to character array. *)
-  val to_chararray : t -> char array
-  (* type conver to character list. *)
-  val to_charlist : t -> char list
-end
-
-(* Functor to make new Stringable module. *)
-module Make (T : Type) : S with type t := T.t
+(* Stringable Type. *)
+module type Type =
+sig
+  type t
+  (* translate t into string. *)
+  val to_string : t -> string
+end
+
+(* Signature of Stringable. *)
+module type S =
+sig
+  type t
+  (* printing type with Format.fomatter. *)
+  val print : Format.formatter -> t -> unit
+  (* type convert to character array. *)
+  val to_chararray : t -> char array
+  (* type conver to character list. *)
+  val to_charlist : t -> char list
+end
+
+(* Functor to make new Stringable module. *)
+module Make (T : Type) : S with type t := T.t
diff --git a/lib/baselib/src/typedCollection.ml b/lib/baselib/src/typedCollection.ml
index 0cd0b6c..6757036 100644
--- a/lib/baselib/src/typedCollection.ml
+++ b/lib/baselib/src/typedCollection.ml
@@ -1,51 +1,51 @@
-module type Type =
-sig
-  type 'a t
-  val empty : 'a t
-  (* add element for elt to t *)
-  val add : 'a -> 'a t -> 'a t
-  (* apply each element of t with first element is 'a *)
-  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-end
-
-module type S =
-sig
-  type 'a t
-  (* folding with index of element in t *)
-  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-  (* execute affects with index of element of t *)
-  val iteri : (int -> 'a -> unit) -> 'a t -> unit
-  (* append element to t if arg is Some. *)
-  val add_option : 'a option -> 'a t -> 'a t
-  (* convert t from list. *)
-  val of_list : 'a list -> 'a t
-  (* convert list from t *)
-  val to_list : 'a t -> 'a list
-  (* add all element of list to given t. *)
-  val add_list : 'a list -> 'a t -> 'a t
-end
-
-module Make (T:Type) : S with type 'a t := 'a T.t =
-struct
-  open T
-  let foldi f =
-    let i = ref (-1) in
-    fold (fun e t -> i := !i + 1; f !i e t)
-
-  let iteri f t =
-    foldi (fun i e () -> f i e; ()) t ()
-
-  let add_option = function
-    | None -> Prelude.id
-    | Some x -> add x
-
-  let of_list l =
-    List.fold_right add l empty
-
-  let to_list t =
-    List.rev (fold (fun x l -> x::l) t [])
-
-  let add_list l t =
-    List.fold_left (Prelude.flip add) t l
-
-end
+module type Type =
+sig
+  type 'a t
+  val empty : 'a t
+  (* add element for elt to t *)
+  val add : 'a -> 'a t -> 'a t
+  (* apply each element of t with first element is 'a *)
+  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+end
+
+module type S =
+sig
+  type 'a t
+  (* folding with index of element in t *)
+  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+  (* execute affects with index of element of t *)
+  val iteri : (int -> 'a -> unit) -> 'a t -> unit
+  (* append element to t if arg is Some. *)
+  val add_option : 'a option -> 'a t -> 'a t
+  (* convert t from list. *)
+  val of_list : 'a list -> 'a t
+  (* convert list from t *)
+  val to_list : 'a t -> 'a list
+  (* add all element of list to given t. *)
+  val add_list : 'a list -> 'a t -> 'a t
+end
+
+module Make (T:Type) : S with type 'a t := 'a T.t =
+struct
+  open T
+  let foldi f =
+    let i = ref (-1) in
+    fold (fun e t -> i := !i + 1; f !i e t)
+
+  let iteri f t =
+    foldi (fun i e () -> f i e; ()) t ()
+
+  let add_option = function
+    | None -> Prelude.id
+    | Some x -> add x
+
+  let of_list l =
+    List.fold_right add l empty
+
+  let to_list t =
+    List.rev (fold (fun x l -> x::l) t [])
+
+  let add_list l t =
+    List.fold_left (Prelude.flip add) t l
+
+end
diff --git a/lib/baselib/src/typedCollection.mli b/lib/baselib/src/typedCollection.mli
index 9b55969..6a6c663 100644
--- a/lib/baselib/src/typedCollection.mli
+++ b/lib/baselib/src/typedCollection.mli
@@ -1,28 +1,28 @@
-module type Type =
-sig
-  type 'a t
-  val empty : 'a t
-  (* add element for elt to t *)
-  val add : 'a -> 'a t -> 'a t
-  (* apply each element of t with first element is 'a *)
-  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-end
-
-module type S =
-sig
-  type 'a t
-  (* folding with index of element in t *)
-  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
-  (* execute affects with index of element of t *)
-  val iteri : (int -> 'a -> unit) -> 'a t -> unit
-  (* append element to t if arg is Some. *)
-  val add_option : 'a option -> 'a t -> 'a t
-  (* convert t from list. *)
-  val of_list : 'a list -> 'a t
-  (* convert list from t *)
-  val to_list : 'a t -> 'a list
-  (* add all element of list to given t. *)
-  val add_list : 'a list -> 'a t -> 'a t
-end
-
-module Make (T:Type) : S with type 'a t := 'a T.t
+module type Type =
+sig
+  type 'a t
+  val empty : 'a t
+  (* add element for elt to t *)
+  val add : 'a -> 'a t -> 'a t
+  (* apply each element of t with first element is 'a *)
+  val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+end
+
+module type S =
+sig
+  type 'a t
+  (* folding with index of element in t *)
+  val foldi : (int -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+  (* execute affects with index of element of t *)
+  val iteri : (int -> 'a -> unit) -> 'a t -> unit
+  (* append element to t if arg is Some. *)
+  val add_option : 'a option -> 'a t -> 'a t
+  (* convert t from list. *)
+  val of_list : 'a list -> 'a t
+  (* convert list from t *)
+  val to_list : 'a t -> 'a list
+  (* add all element of list to given t. *)
+  val add_list : 'a list -> 'a t -> 'a t
+end
+
+module Make (T:Type) : S with type 'a t := 'a T.t
diff --git a/lib/baselib/src/typedComparable.ml b/lib/baselib/src/typedComparable.ml
index 1762e64..4b3d265 100644
--- a/lib/baselib/src/typedComparable.ml
+++ b/lib/baselib/src/typedComparable.ml
@@ -1,31 +1,31 @@
-
-module type Type =
-sig
-  type 'a t
-  val compare : 'a t -> 'a t -> int
-end
-
-module type S =
-sig
-  type 'a t
-
-  val eq : 'a t -> 'a t -> bool
-  val ne : 'a t -> 'a t -> bool
-  val gt : 'a t -> 'a t -> bool
-  val ge : 'a t -> 'a t -> bool
-  val lt : 'a t -> 'a t -> bool
-  val le : 'a t -> 'a t -> bool
-end
-
-(* using this module when need order functions. *)
-module Make (T : Type) : S with type 'a t := 'a T.t =
-struct
-  open T
-
-  let eq x y = compare x y = 0
-  let ne x y = compare x y <> 0
-  let gt x y = compare x y > 0
-  let ge x y = compare x y >= 0
-  let lt x y = compare x y < 0
-  let le x y = compare x y <= 0
-end
+
+module type Type =
+sig
+  type 'a t
+  val compare : 'a t -> 'a t -> int
+end
+
+module type S =
+sig
+  type 'a t
+
+  val eq : 'a t -> 'a t -> bool
+  val ne : 'a t -> 'a t -> bool
+  val gt : 'a t -> 'a t -> bool
+  val ge : 'a t -> 'a t -> bool
+  val lt : 'a t -> 'a t -> bool
+  val le : 'a t -> 'a t -> bool
+end
+
+(* using this module when need order functions. *)
+module Make (T : Type) : S with type 'a t := 'a T.t =
+struct
+  open T
+
+  let eq x y = compare x y = 0
+  let ne x y = compare x y <> 0
+  let gt x y = compare x y > 0
+  let ge x y = compare x y >= 0
+  let lt x y = compare x y < 0
+  let le x y = compare x y <= 0
+end
diff --git a/lib/baselib/src/typedComparable.mli b/lib/baselib/src/typedComparable.mli
index a6aac21..84e8a84 100644
--- a/lib/baselib/src/typedComparable.mli
+++ b/lib/baselib/src/typedComparable.mli
@@ -1,35 +1,35 @@
-
-(* this module is used to functor when needs some modules to compare t
-   with type variable.  *)
-module type Type =
-sig
-  type 'a t
-  (* compare elements. if first @t@ is less than second, return -1.
-     if first @t@ equal second, return 0.
-     return 1 if first @t@ is greater than second.
-  *)
-  val compare : 'a t -> 'a t -> int
-end
-
-module type S =
-sig
-  (* element type of this signature. this is had to overwrite when
-     using any module. *)
-  type 'a t
-
-  (* equals *)
-  val eq : 'a t -> 'a t -> bool
-  (* no'a t equals *)
-  val ne : 'a t -> 'a t -> bool
-  (* greater than *)
-  val gt : 'a t -> 'a t -> bool
-  (* greater equal *)
-  val ge : 'a t -> 'a t -> bool
-  (* less than *)
-  val lt : 'a t -> 'a t -> bool
-  (* less equal *)
-  val le : 'a t -> 'a t -> bool
-end
-
-(* using this module when need order functions. *)
-module Make (T : Type) : S with type 'a t := 'a T.t
+
+(* this module is used to functor when needs some modules to compare t
+   with type variable.  *)
+module type Type =
+sig
+  type 'a t
+  (* compare elements. if first @t@ is less than second, return -1.
+     if first @t@ equal second, return 0.
+     return 1 if first @t@ is greater than second.
+  *)
+  val compare : 'a t -> 'a t -> int
+end
+
+module type S =
+sig
+  (* element type of this signature. this is had to overwrite when
+     using any module. *)
+  type 'a t
+
+  (* equals *)
+  val eq : 'a t -> 'a t -> bool
+  (* no'a t equals *)
+  val ne : 'a t -> 'a t -> bool
+  (* greater than *)
+  val gt : 'a t -> 'a t -> bool
+  (* greater equal *)
+  val ge : 'a t -> 'a t -> bool
+  (* less than *)
+  val lt : 'a t -> 'a t -> bool
+  (* less equal *)
+  val le : 'a t -> 'a t -> bool
+end
+
+(* using this module when need order functions. *)
+module Make (T : Type) : S with type 'a t := 'a T.t
diff --git a/lib/baselib/src/typedStringable.ml b/lib/baselib/src/typedStringable.ml
index 51ac89a..86d43fe 100644
--- a/lib/baselib/src/typedStringable.ml
+++ b/lib/baselib/src/typedStringable.ml
@@ -1,28 +1,28 @@
-
-module type Type =
-sig
-  type 'a t
-  val to_string : 'a t -> string
-end
-
-module type S =
-sig
-  type 'a t
-  val print : Format.formatter -> 'a t -> unit
-  val to_chararray : 'a t -> char array
-  val to_charlist : 'a t -> char list
-end
-
-module Make (T : Type) : S with type 'a t := 'a T.t =
-struct
-  open T
-
-  let print fmt t = Format.fprintf fmt "%s" (to_string t)
-
-  let to_chararray t =
-    let s = to_string t in
-    Array.init (String.length s) (String.get s)
-
-  let to_charlist t =
-    Array.to_list (to_chararray t)
-end
+
+module type Type =
+sig
+  type 'a t
+  val to_string : 'a t -> string
+end
+
+module type S =
+sig
+  type 'a t
+  val print : Format.formatter -> 'a t -> unit
+  val to_chararray : 'a t -> char array
+  val to_charlist : 'a t -> char list
+end
+
+module Make (T : Type) : S with type 'a t := 'a T.t =
+struct
+  open T
+
+  let print fmt t = Format.fprintf fmt "%s" (to_string t)
+
+  let to_chararray t =
+    let s = to_string t in
+    Array.init (String.length s) (String.get s)
+
+  let to_charlist t =
+    Array.to_list (to_chararray t)
+end
diff --git a/lib/baselib/src/typedStringable.mli b/lib/baselib/src/typedStringable.mli
index bd40d77..b94dcd6 100644
--- a/lib/baselib/src/typedStringable.mli
+++ b/lib/baselib/src/typedStringable.mli
@@ -1,22 +1,22 @@
-(* Stringable Type. *)
-module type Type =
-sig
-  type 'a t
-  (* translate t into string. *)
-  val to_string : 'a t -> string
-end
-
-(* Signature of Stringable. *)
-module type S =
-sig
-  type 'a t
-  (* printing type with Format.fomatter. *)
-  val print : Format.formatter -> 'a t -> unit
-  (* type convert to character array. *)
-  val to_chararray : 'a t -> char array
-  (* type conver to character list. *)
-  val to_charlist : 'a t -> char list
-end
-
-(* Functor to make new Stringable module. *)
-module Make (T : Type) : S with type 'a t := 'a T.t
+(* Stringable Type. *)
+module type Type =
+sig
+  type 'a t
+  (* translate t into string. *)
+  val to_string : 'a t -> string
+end
+
+(* Signature of Stringable. *)
+module type S =
+sig
+  type 'a t
+  (* printing type with Format.fomatter. *)
+  val print : Format.formatter -> 'a t -> unit
+  (* type convert to character array. *)
+  val to_chararray : 'a t -> char array
+  (* type conver to character list. *)
+  val to_charlist : 'a t -> char list
+end
+
+(* Functor to make new Stringable module. *)
+module Make (T : Type) : S with type 'a t := 'a T.t
diff --git a/src/OMakefile b/src/OMakefile
index 6d390bf..e7a636f 100644
--- a/src/OMakefile
+++ b/src/OMakefile
@@ -1,91 +1,92 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-open MyOCaml
-
-########################################################################
-# Phony targets are scoped, so you probably want to declare them first.
-#
-
-.PHONY: all install clean
-
-########################################################################
-# Subdirectories.
-# You may want to include some subdirectories in this project.
-# If so, define the subdirectory targets and uncomment this section.
-#
-
-# .SUBDIRS:
-
-################################################
-# Configuration.  You may want to modify any of these configuration
-# variables.
-#
-
-#
-# This project requires ocamlfind (default - false).
-#
-USE_OCAMLFIND = true
-#
-OCAMLPACKS[] =
-#    pack1
-#    pack2
-#
-if $(not $(OCAMLFIND_EXISTS))
-   eprintln(This project requires ocamlfind, but is was not found.)
-   eprintln(You need to install ocamlfind and run "omake --configure".)
-   exit 1
-
-#
-# Include path
-#
-OCAMLINCLUDES += ../lib/baselib/build/
-
-#
-# Compile native or byte code?
-#
-# The default values are defined as follows:
-#
-NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-#
-# Various options
-#
-OCAMLFLAGS    += -annot -bin-annot
-# OCAMLCFLAGS   +=
-# OCAMLOPTFLAGS +=
-# OCAML_LINK_FLAGS +=
-# OCAML_BYTE_LINK_FLAGS +=
-# OCAML_NATIVE_LINK_FLAGS +=
-
-################################################
-# Build an OCaml library
-#
-
-FILES[] = $(removesuffix $(ls *.ml))
-FILES += json_lexer json_parser
-#    file1
-#    file2
-#
-LIB = json_ocaml
-#
-MyOCamlPackage($(LIB), $(FILES), $(EMPTY), -linkall, true)
-
-.DEFAULT: $(OCamlPackageGeneratedFiles $(LIB), false)
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+open MyOCaml
+
+########################################################################
+# Phony targets are scoped, so you probably want to declare them first.
+#
+
+.PHONY: all install clean
+
+########################################################################
+# Subdirectories.
+# You may want to include some subdirectories in this project.
+# If so, define the subdirectory targets and uncomment this section.
+#
+
+# .SUBDIRS:
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+
+#
+# This project requires ocamlfind (default - false).
+#
+USE_OCAMLFIND = true
+#
+OCAMLPACKS[] =
+     str
+#    pack1
+#    pack2
+#
+if $(not $(OCAMLFIND_EXISTS))
+   eprintln(This project requires ocamlfind, but is was not found.)
+   eprintln(You need to install ocamlfind and run "omake --configure".)
+   exit 1
+
+#
+# Include path
+#
+OCAMLINCLUDES += ../lib/baselib/build/
+
+#
+# Compile native or byte code?
+#
+# The default values are defined as follows:
+#
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = true
+
+#
+# Various options
+#
+OCAMLFLAGS    += -annot -bin-annot
+# OCAMLCFLAGS   +=
+# OCAMLOPTFLAGS +=
+# OCAML_LINK_FLAGS +=
+# OCAML_BYTE_LINK_FLAGS +=
+# OCAML_NATIVE_LINK_FLAGS +=
+
+################################################
+# Build an OCaml library
+#
+
+FILES[] = $(removesuffix $(ls *.ml))
+FILES += json_lexer json_parser
+#    file1
+#    file2
+#
+LIB = json_ocaml
+#
+MyOCamlPackage($(LIB), $(FILES), $(EMPTY), -linkall, true)
+
+.DEFAULT: $(OCamlPackageGeneratedFiles $(LIB), false)
diff --git a/src/json.ml b/src/json.ml
index 99e09af..8048ced 100644
--- a/src/json.ml
+++ b/src/json.ml
@@ -1,17 +1,17 @@
-
-module Decoder = Json_decoder
-module Encoder = Json_encoder
-
-module Type = Json_type
-
-module E = Baselib.Std.Either
-
-(** type of json  *)
-type t = Type.t
-
-type result = Type.result
-
-let encode = Encoder.encode
-
-let decode = Decoder.decode
-
+
+module Decoder = Json_decoder
+module Encoder = Json_encoder
+
+module Type = Json_type
+
+module E = Baselib.Std.Either
+
+(** type of json  *)
+type t = Type.t
+
+type result = Type.result
+
+let encode = Encoder.encode
+
+let decode = Decoder.decode
+
diff --git a/src/json.mli b/src/json.mli
index 2443491..5a87fb2 100644
--- a/src/json.mli
+++ b/src/json.mli
@@ -1,24 +1,24 @@
-
-(** The JSON Decoder module  *)
-module Decoder : sig
-  include module type of Json_decoder
-end
-
-(** The JSON Encoder module *)
-module Encoder : sig
-  include module type of Json_encoder
-end
-
-(** The module having some types for JSON other modules *)
-module Type : sig
-  include module type of Json_type
-end
-
-(** type of json  *)
-type t = Type.t
-
-(** encode Json type structure to stringified JSON. *)
-val encode : t -> string
-
-(** Decode stringified JSON to be type structured json. *)
-val decode : string -> Type.result
+
+(** The JSON Decoder module  *)
+module Decoder : sig
+  include module type of Json_decoder
+end
+
+(** The JSON Encoder module *)
+module Encoder : sig
+  include module type of Json_encoder
+end
+
+(** The module having some types for JSON other modules *)
+module Type : sig
+  include module type of Json_type
+end
+
+(** type of json  *)
+type t = Type.t
+
+(** encode Json type structure to stringified JSON. *)
+val encode : t -> string
+
+(** Decode stringified JSON to be type structured json. *)
+val decode : string -> Type.result
diff --git a/src/json_decoder.ml b/src/json_decoder.ml
index a038cc6..1d4e064 100644
--- a/src/json_decoder.ml
+++ b/src/json_decoder.ml
@@ -1,8 +1,8 @@
-
-module E = Baselib.Std.Either
-
-let decode str =
-  let lexbuf = Lexing.from_string str in
-  try
-    E.Right(Json_parser.parser_main Json_lexer.token lexbuf)
-  with Parsing.Parse_error -> E.Left("Parse error")
+
+module E = Baselib.Std.Either
+
+let decode str =
+  let lexbuf = Lexing.from_string str in
+  try
+    E.Right(Json_parser.parser_main Json_lexer.token lexbuf)
+  with Parsing.Parse_error -> E.Left("Parse error")
diff --git a/src/json_decoder.mli b/src/json_decoder.mli
index 2b2438e..24f6d8d 100644
--- a/src/json_decoder.mli
+++ b/src/json_decoder.mli
@@ -1,3 +1,3 @@
-
-(** Decode stringified JSON to be type structured json via Json_decoder.decode *)
-val decode : string -> Json_type.result
+
+(** Decode stringified JSON to be type structured json via Json_decoder.decode *)
+val decode : string -> Json_type.result
diff --git a/src/json_encoder.ml b/src/json_encoder.ml
index 131f06b..3583d48 100644
--- a/src/json_encoder.ml
+++ b/src/json_encoder.ml
@@ -1,32 +1,34 @@
-
-open Baselib.Std.Prelude
-
-module T = Json_type
-
-let bool_to_json = function
-  | true -> "true"
-  | false -> "false"
-;;
-
-let string_to_json (s:string) : string = "\"" ^ s ^ "\""
-;;
-
-let number_to_json (s:float) :string =
-  let f = string_of_float s in
-  let rindex = String.rindex f '.' in
-  if rindex = (pred |< String.length f) then f ^ "0" else f
-;;
-
-let rec (encode_per_type : T.t -> string) = function
-  | T.Bool(b) -> bool_to_json b
-  | T.Null -> "null"
-  | T.String(s) -> string_to_json s
-  | T.Number(n) -> number_to_json n
-  | T.Array(a) -> "[" ^ (List.map encode_per_type a |> String.concat ",") ^ "]"
-  | T.Object(o) ->
-    let pair_to_json (key, value) = "\"" ^ key ^ "\":" ^ (encode_per_type value) in
-    "{" ^ (List.map pair_to_json o |> String.concat ",") ^ "}"
-;;
-
-let encode = encode_per_type
-;;
+
+open Baselib.Std.Prelude
+
+module T = Json_type
+
+let bool_to_json = function
+  | true -> "true"
+  | false -> "false"
+;;
+
+let string_to_json (s:string) : string =
+  let replaced = Str.global_replace (Str.regexp "([\b\t\r\n])") "\\$1" s in
+  "\"" ^ replaced ^ "\""
+;;
+
+let number_to_json (s:float) :string =
+  let f = string_of_float s in
+  let rindex = String.rindex f '.' in
+  if rindex = (pred |< String.length f) then f ^ "0" else f
+;;
+
+let rec (encode_per_type : T.t -> string) = function
+  | T.Bool(b) -> bool_to_json b
+  | T.Null -> "null"
+  | T.String(s) -> string_to_json s
+  | T.Number(n) -> number_to_json n
+  | T.Array(a) -> "[" ^ (List.map encode_per_type a |> String.concat ",") ^ "]"
+  | T.Object(o) ->
+    let pair_to_json (key, value) = "\"" ^ key ^ "\":" ^ (encode_per_type value) in
+    "{" ^ (List.map pair_to_json o |> String.concat ",") ^ "}"
+;;
+
+let encode = encode_per_type
+;;
diff --git a/src/json_encoder.mli b/src/json_encoder.mli
index 4a8e958..7338d9c 100644
--- a/src/json_encoder.mli
+++ b/src/json_encoder.mli
@@ -1,3 +1,3 @@
-
-(** Encode Json data type to valid stringified JSON. *)
-val encode : Json_type.t -> string
+
+(** Encode Json data type to valid stringified JSON. *)
+val encode : Json_type.t -> string
diff --git a/src/json_lexer.ml b/src/json_lexer.ml
index 378dc0c..aa96899 100644
--- a/src/json_lexer.ml
+++ b/src/json_lexer.ml
@@ -1,6 +1,6 @@
 # 1 "json_lexer.mll"
-
-  open Json_parser
+
+  open Json_parser

 # 6 "json_lexer.ml"
 let __ocaml_lex_tables = {
diff --git a/src/json_lexer.mll b/src/json_lexer.mll
index 1635d52..5e019ef 100644
--- a/src/json_lexer.mll
+++ b/src/json_lexer.mll
@@ -1,25 +1,25 @@
-{
-  open Json_parser
-}
-(* Json Tokens *)
-rule token = parse
-    [' ' '\t' '\n']    {token lexbuf }
-    | '{' { LPAREN }
-    | '[' { LBRACE }
-    | '}' { RPAREN }
-    | ']' { RBRACE }
-    | ':' { COLON }
-    | ',' { COMMA }
-    | '-' { MINUS }
-    | '+' { PLUS }
-    | "true" { TRUE }
-    | "false" {FALSE}
-    | "null" {NULL}
-    | ['0'-'9']+ as digit { DIGIT(digit) }
-    | '.' { DOT }
-    | '"' { DOUBLE_QUOTE }
-    | ['e' 'E'] as exp { EXP(exp) }
-    | '\\' ['"' '\\' '/' 'b' 'f' 'n' 'r' 't']  as ctl { CONTROL_CHAR(ctl) }
-    | "\\u"['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F'] as ctl { CONTROL_CHAR(ctl) }
-    | eof  {EOF}
-    | _ as c { CHAR(c) }
+{
+  open Json_parser
+}
+(* Json Tokens *)
+rule token = parse
+    [' ' '\t' '\n']    {token lexbuf }
+    | '{' { LPAREN }
+    | '[' { LBRACE }
+    | '}' { RPAREN }
+    | ']' { RBRACE }
+    | ':' { COLON }
+    | ',' { COMMA }
+    | '-' { MINUS }
+    | '+' { PLUS }
+    | "true" { TRUE }
+    | "false" {FALSE}
+    | "null" {NULL}
+    | ['0'-'9']+ as digit { DIGIT(digit) }
+    | '.' { DOT }
+    | '"' { DOUBLE_QUOTE }
+    | ['e' 'E'] as exp { EXP(exp) }
+    | '\\' ['"' '\\' '/' 'b' 'f' 'n' 'r' 't']  as ctl { CONTROL_CHAR(ctl) }
+    | "\\u"['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F']['0'-'9' 'a'-'f' 'A'-'F'] as ctl { CONTROL_CHAR(ctl) }
+    | eof  {EOF}
+    | _ as c { CHAR(c) }
diff --git a/src/json_parser.ml b/src/json_parser.ml
index 7e034c8..819102f 100644
--- a/src/json_parser.ml
+++ b/src/json_parser.ml
@@ -23,17 +23,18 @@ type token =

 open Parsing;;
 let _ = parse_error;;
-# 4 "json_parser.mly"
-    let to_str = function
-      | Json_type.String(s) -> "string:" ^ s
-      | Json_type.Number(_) -> "number"
-      | Json_type.Object(_) -> "object"
-      | Json_type.Array(_) -> "array"
-      | Json_type.Null -> "null"
-      | Json_type.Bool(_) -> "bool"
-
+# 3 "json_parser.mly"
+
+    let to_str = function
+      | Json_type.String(s) -> "string:" ^ s
+      | Json_type.Number(_) -> "number"
+      | Json_type.Object(_) -> "object"
+      | Json_type.Array(_) -> "array"
+      | Json_type.Null -> "null"
+      | Json_type.Bool(_) -> "bool"
+

-# 37 "json_parser.ml"
+# 38 "json_parser.ml"
 let yytransl_const = [|
   258 (* LPAREN *);
   259 (* LBRACE *);
@@ -228,73 +229,73 @@ let yyact = [|
     Obj.repr(
 # 29 "json_parser.mly"
             (_1)
-# 232 "json_parser.ml"
+# 233 "json_parser.ml"
                : Json_type.t))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'string) in
     Obj.repr(
 # 33 "json_parser.mly"
              ( Json_type.String(_1) )
-# 239 "json_parser.ml"
+# 240 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'number) in
     Obj.repr(
 # 34 "json_parser.mly"
              ( Json_type.Number(_1) )
-# 246 "json_parser.ml"
+# 247 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'array) in
     Obj.repr(
 # 35 "json_parser.mly"
              ( Json_type.Array(_1) )
-# 253 "json_parser.ml"
+# 254 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'obj) in
     Obj.repr(
 # 36 "json_parser.mly"
              ( Json_type.Object(_1) )
-# 260 "json_parser.ml"
+# 261 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 37 "json_parser.mly"
              ( Json_type.Bool(true) )
-# 266 "json_parser.ml"
+# 267 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 38 "json_parser.mly"
              ( Json_type.Bool(false) )
-# 272 "json_parser.ml"
+# 273 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 39 "json_parser.mly"
              ( Json_type.Null )
-# 278 "json_parser.ml"
+# 279 "json_parser.ml"
                : 'value))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 43 "json_parser.mly"
                   ( [] )
-# 284 "json_parser.ml"
+# 285 "json_parser.ml"
                : 'obj))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 1 : 'members) in
     Obj.repr(
 # 44 "json_parser.mly"
                          (_2 )
-# 291 "json_parser.ml"
+# 292 "json_parser.ml"
                : 'obj))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pair) in
     Obj.repr(
 # 48 "json_parser.mly"
                   ( [_1] )
-# 298 "json_parser.ml"
+# 299 "json_parser.ml"
                : 'members))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pair) in
@@ -302,7 +303,7 @@ let yyact = [|
     Obj.repr(
 # 49 "json_parser.mly"
                       ( _1 :: _3 )
-# 306 "json_parser.ml"
+# 307 "json_parser.ml"
                : 'members))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 2 : 'string) in
@@ -310,27 +311,27 @@ let yyact = [|
     Obj.repr(
 # 53 "json_parser.mly"
                      ( (_1, _3) )
-# 314 "json_parser.ml"
+# 315 "json_parser.ml"
                : 'pair))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 57 "json_parser.mly"
                  ( [] )
-# 320 "json_parser.ml"
+# 321 "json_parser.ml"
                : 'array))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 1 : 'elements) in
     Obj.repr(
 # 58 "json_parser.mly"
                            ( _2 )
-# 327 "json_parser.ml"
+# 328 "json_parser.ml"
                : 'array))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'value) in
     Obj.repr(
 # 62 "json_parser.mly"
            ( [_1] )
-# 334 "json_parser.ml"
+# 335 "json_parser.ml"
                : 'elements))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 2 : 'value) in
@@ -338,27 +339,27 @@ let yyact = [|
     Obj.repr(
 # 63 "json_parser.mly"
                          ( _1 :: _3 )
-# 342 "json_parser.ml"
+# 343 "json_parser.ml"
                : 'elements))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 67 "json_parser.mly"
                              ( "" )
-# 348 "json_parser.ml"
+# 349 "json_parser.ml"
                : 'string))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 1 : 'chars) in
     Obj.repr(
 # 68 "json_parser.mly"
                                     ( _2 )
-# 355 "json_parser.ml"
+# 356 "json_parser.ml"
                : 'string))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'char) in
     Obj.repr(
 # 72 "json_parser.mly"
         ( _1 )
-# 362 "json_parser.ml"
+# 363 "json_parser.ml"
                : 'chars))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : 'char) in
@@ -366,84 +367,84 @@ let yyact = [|
     Obj.repr(
 # 73 "json_parser.mly"
               ( _1 ^ _2 )
-# 370 "json_parser.ml"
+# 371 "json_parser.ml"
                : 'chars))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
     Obj.repr(
 # 77 "json_parser.mly"
                  ( _1 )
-# 377 "json_parser.ml"
+# 378 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
     Obj.repr(
 # 78 "json_parser.mly"
                  ( _1 )
-# 384 "json_parser.ml"
+# 385 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : char) in
     Obj.repr(
 # 79 "json_parser.mly"
                  ( Char.escaped(_1) )
-# 391 "json_parser.ml"
+# 392 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 80 "json_parser.mly"
                  ( "." )
-# 397 "json_parser.ml"
+# 398 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 81 "json_parser.mly"
                  ( "-" )
-# 403 "json_parser.ml"
+# 404 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 82 "json_parser.mly"
                  ( "+" )
-# 409 "json_parser.ml"
+# 410 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 83 "json_parser.mly"
                  ( "{" )
-# 415 "json_parser.ml"
+# 416 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 84 "json_parser.mly"
                  ( "}" )
-# 421 "json_parser.ml"
+# 422 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 85 "json_parser.mly"
                  ( "(" )
-# 427 "json_parser.ml"
+# 428 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     Obj.repr(
 # 86 "json_parser.mly"
                  ( ")" )
-# 433 "json_parser.ml"
+# 434 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : char) in
     Obj.repr(
 # 87 "json_parser.mly"
                  ( Char.escaped(_1) )
-# 440 "json_parser.ml"
+# 441 "json_parser.ml"
                : 'char))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : 'integer) in
     Obj.repr(
 # 90 "json_parser.mly"
                  ( float_of_string(_1) )
-# 447 "json_parser.ml"
+# 448 "json_parser.ml"
                : 'number))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : 'integer) in
@@ -451,7 +452,7 @@ let yyact = [|
     Obj.repr(
 # 91 "json_parser.mly"
                  ( float_of_string(_1 ^ _2) )
-# 455 "json_parser.ml"
+# 456 "json_parser.ml"
                : 'number))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : 'integer) in
@@ -459,7 +460,7 @@ let yyact = [|
     Obj.repr(
 # 92 "json_parser.mly"
                  ( float_of_string(_1 ^ _2) )
-# 463 "json_parser.ml"
+# 464 "json_parser.ml"
                : 'number))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 2 : 'integer) in
@@ -468,14 +469,14 @@ let yyact = [|
     Obj.repr(
 # 93 "json_parser.mly"
                     ( float_of_string(_1 ^ _2 ^ _3) )
-# 472 "json_parser.ml"
+# 473 "json_parser.ml"
                : 'number))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
     Obj.repr(
 # 97 "json_parser.mly"
            ( _1 )
-# 479 "json_parser.ml"
+# 480 "json_parser.ml"
                : 'integer))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
@@ -483,14 +484,14 @@ let yyact = [|
     Obj.repr(
 # 98 "json_parser.mly"
                  ( _1 ^ _2 )
-# 487 "json_parser.ml"
+# 488 "json_parser.ml"
                : 'integer))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
     Obj.repr(
 # 99 "json_parser.mly"
                ( "-" ^ _2 )
-# 494 "json_parser.ml"
+# 495 "json_parser.ml"
                : 'integer))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
@@ -498,14 +499,14 @@ let yyact = [|
     Obj.repr(
 # 100 "json_parser.mly"
                       ( "-" ^ _2 ^ _3 )
-# 502 "json_parser.ml"
+# 503 "json_parser.ml"
                : 'integer))
 ; (fun __caml_parser_env ->
     let _2 = (Parsing.peek_val __caml_parser_env 0 : 'digits) in
     Obj.repr(
 # 104 "json_parser.mly"
              ( "." ^ _2 )
-# 509 "json_parser.ml"
+# 510 "json_parser.ml"
                : 'frac))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : 'e) in
@@ -513,14 +514,14 @@ let yyact = [|
     Obj.repr(
 # 108 "json_parser.mly"
            ( "e" ^ _2 )
-# 517 "json_parser.ml"
+# 518 "json_parser.ml"
                : 'exp))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
     Obj.repr(
 # 112 "json_parser.mly"
          ( _1 )
-# 524 "json_parser.ml"
+# 525 "json_parser.ml"
                : 'digits))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
@@ -528,28 +529,28 @@ let yyact = [|
     Obj.repr(
 # 113 "json_parser.mly"
                ( _1 ^ _2 )
-# 532 "json_parser.ml"
+# 533 "json_parser.ml"
                : 'digits))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 0 : char) in
     Obj.repr(
 # 117 "json_parser.mly"
        ( Char.escaped(_1) )
-# 539 "json_parser.ml"
+# 540 "json_parser.ml"
                : 'e))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : char) in
     Obj.repr(
 # 118 "json_parser.mly"
             ( Char.escaped(_1) ^ "+")
-# 546 "json_parser.ml"
+# 547 "json_parser.ml"
                : 'e))
 ; (fun __caml_parser_env ->
     let _1 = (Parsing.peek_val __caml_parser_env 1 : char) in
     Obj.repr(
 # 119 "json_parser.mly"
              ( Char.escaped(_1) ^ "-" )
-# 553 "json_parser.ml"
+# 554 "json_parser.ml"
                : 'e))
 (* Entry parser_main *)
 ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
diff --git a/src/json_parser.mly b/src/json_parser.mly
index 87c6b88..541c055 100644
--- a/src/json_parser.mly
+++ b/src/json_parser.mly
@@ -1,120 +1,120 @@
-/* jsonのパーサー */
-
-  %{
-    let to_str = function
-      | Json_type.String(s) -> "string:" ^ s
-      | Json_type.Number(_) -> "number"
-      | Json_type.Object(_) -> "object"
-      | Json_type.Array(_) -> "array"
-      | Json_type.Null -> "null"
-      | Json_type.Bool(_) -> "bool"
-
-  %}
-
-%token <string> STRING
-%token LPAREN LBRACE RPAREN RBRACE COLON COMMA MINUS PLUS TRUE FALSE NULL
-%token DOT DOUBLE_QUOTE
-%token <char> EXP
-%token <string> DIGIT
-%token <char> CHAR
-%token EOF
-%token <string> CONTROL_CHAR
-%token <float> NUMBER
-%token <bool> BOOL
-%start parser_main
-%type <Json_type.t> parser_main
-%%
-
-parser_main:
-  value EOF {$1}
-;
-
-value:
-  string     { Json_type.String($1) }
- | number    { Json_type.Number($1) }
- | array     { Json_type.Array($1) }
- | obj       { Json_type.Object($1) }
- | TRUE      { Json_type.Bool(true) }
- | FALSE     { Json_type.Bool(false) }
- | NULL      { Json_type.Null }
-;
-
-obj:
-   LPAREN RPAREN  { [] }
- | LPAREN members RPAREN {$2 }
-;
-
-members:
-   pair           { [$1] }
- | pair COMMA members { $1 :: $3 }
-;
-
-pair:
-  string COLON value { ($1, $3) }
-;
-
-array:
-  LBRACE RBRACE  { [] }
- | LBRACE elements RBRACE  { $2 }
-;
-
-elements:
-  value    { [$1] }
- | value COMMA elements  { $1 :: $3 }
-;
-
-string:
-  DOUBLE_QUOTE DOUBLE_QUOTE  { "" }
- | DOUBLE_QUOTE chars DOUBLE_QUOTE  { $2 }
-;
-
-chars:
-  char  { $1 }
- | char chars { $1 ^ $2 }
-;
-
-char:
-  CONTROL_CHAR   { $1 }
- | DIGIT         { $1 }
- | EXP           { Char.escaped($1) }
- | DOT           { "." }
- | MINUS         { "-" }
- | PLUS          { "+" }
- | LBRACE        { "{" }
- | RBRACE        { "}" }
- | LPAREN        { "(" }
- | RPAREN        { ")" }
- | CHAR          { Char.escaped($1) }
-;
-number:
-   integer       { float_of_string($1) }
- | integer frac  { float_of_string($1 ^ $2) }
- | integer exp   { float_of_string($1 ^ $2) }
- | integer frac exp { float_of_string($1 ^ $2 ^ $3) }
-;
-
-integer:
-   DIGIT   { $1 }
- | DIGIT digits  { $1 ^ $2 }
- | MINUS DIGIT { "-" ^ $2 }
- | MINUS DIGIT digits { "-" ^ $2 ^ $3 }
-;
-
-frac:
-  DOT digits { "." ^ $2 }
-;
-
-exp:
-  e digits { "e" ^ $2 }
-;
-
-digits:
-  DIGIT  { $1 }
- |DIGIT digits { $1 ^ $2 }
-;
-
-e:
-  EXP  { Char.escaped($1) }
- | EXP PLUS { Char.escaped($1) ^ "+"}
- | EXP MINUS { Char.escaped($1) ^ "-" }
-;
+/* jsonのパーサー */
+
+  %{
+    let to_str = function
+      | Json_type.String(s) -> "string:" ^ s
+      | Json_type.Number(_) -> "number"
+      | Json_type.Object(_) -> "object"
+      | Json_type.Array(_) -> "array"
+      | Json_type.Null -> "null"
+      | Json_type.Bool(_) -> "bool"
+
+  %}
+
+%token <string> STRING
+%token LPAREN LBRACE RPAREN RBRACE COLON COMMA MINUS PLUS TRUE FALSE NULL
+%token DOT DOUBLE_QUOTE
+%token <char> EXP
+%token <string> DIGIT
+%token <char> CHAR
+%token EOF
+%token <string> CONTROL_CHAR
+%token <float> NUMBER
+%token <bool> BOOL
+%start parser_main
+%type <Json_type.t> parser_main
+%%
+
+parser_main:
+  value EOF {$1}
+;
+
+value:
+  string     { Json_type.String($1) }
+ | number    { Json_type.Number($1) }
+ | array     { Json_type.Array($1) }
+ | obj       { Json_type.Object($1) }
+ | TRUE      { Json_type.Bool(true) }
+ | FALSE     { Json_type.Bool(false) }
+ | NULL      { Json_type.Null }
+;
+
+obj:
+   LPAREN RPAREN  { [] }
+ | LPAREN members RPAREN {$2 }
+;
+
+members:
+   pair           { [$1] }
+ | pair COMMA members { $1 :: $3 }
+;
+
+pair:
+  string COLON value { ($1, $3) }
+;
+
+array:
+  LBRACE RBRACE  { [] }
+ | LBRACE elements RBRACE  { $2 }
+;
+
+elements:
+  value    { [$1] }
+ | value COMMA elements  { $1 :: $3 }
+;
+
+string:
+  DOUBLE_QUOTE DOUBLE_QUOTE  { "" }
+ | DOUBLE_QUOTE chars DOUBLE_QUOTE  { $2 }
+;
+
+chars:
+  char  { $1 }
+ | char chars { $1 ^ $2 }
+;
+
+char:
+  CONTROL_CHAR   { $1 }
+ | DIGIT         { $1 }
+ | EXP           { Char.escaped($1) }
+ | DOT           { "." }
+ | MINUS         { "-" }
+ | PLUS          { "+" }
+ | LBRACE        { "{" }
+ | RBRACE        { "}" }
+ | LPAREN        { "(" }
+ | RPAREN        { ")" }
+ | CHAR          { Char.escaped($1) }
+;
+number:
+   integer       { float_of_string($1) }
+ | integer frac  { float_of_string($1 ^ $2) }
+ | integer exp   { float_of_string($1 ^ $2) }
+ | integer frac exp { float_of_string($1 ^ $2 ^ $3) }
+;
+
+integer:
+   DIGIT   { $1 }
+ | DIGIT digits  { $1 ^ $2 }
+ | MINUS DIGIT { "-" ^ $2 }
+ | MINUS DIGIT digits { "-" ^ $2 ^ $3 }
+;
+
+frac:
+  DOT digits { "." ^ $2 }
+;
+
+exp:
+  e digits { "e" ^ $2 }
+;
+
+digits:
+  DIGIT  { $1 }
+ |DIGIT digits { $1 ^ $2 }
+;
+
+e:
+  EXP  { Char.escaped($1) }
+ | EXP PLUS { Char.escaped($1) ^ "+"}
+ | EXP MINUS { Char.escaped($1) ^ "-" }
+;
diff --git a/src/json_type.ml b/src/json_type.ml
index aa1813f..a0f34f9 100644
--- a/src/json_type.ml
+++ b/src/json_type.ml
@@ -1,10 +1,10 @@
-(** type of json  *)
-type t = String of string               (* String *)
-         | Number of float              (* Number *)
-         | Bool of bool                 (* True or False *)
-         | Array of t list             (* Array *)
-         | Object of (string * t) list               (* Object *)
-         | Null                         (* Null *)
-
-(** results for conversion  *)
-type result = (t, string) Baselib.Std.Either.t
+(** type of json  *)
+type t = String of string               (* String *)
+         | Number of float              (* Number *)
+         | Bool of bool                 (* True or False *)
+         | Array of t list             (* Array *)
+         | Object of (string * t) list               (* Object *)
+         | Null                         (* Null *)
+
+(** results for conversion  *)
+type result = (t, string) Baselib.Std.Either.t
diff --git a/src/json_type.mli b/src/json_type.mli
index aa1813f..a0f34f9 100644
--- a/src/json_type.mli
+++ b/src/json_type.mli
@@ -1,10 +1,10 @@
-(** type of json  *)
-type t = String of string               (* String *)
-         | Number of float              (* Number *)
-         | Bool of bool                 (* True or False *)
-         | Array of t list             (* Array *)
-         | Object of (string * t) list               (* Object *)
-         | Null                         (* Null *)
-
-(** results for conversion  *)
-type result = (t, string) Baselib.Std.Either.t
+(** type of json  *)
+type t = String of string               (* String *)
+         | Number of float              (* Number *)
+         | Bool of bool                 (* True or False *)
+         | Array of t list             (* Array *)
+         | Object of (string * t) list               (* Object *)
+         | Null                         (* Null *)
+
+(** results for conversion  *)
+type result = (t, string) Baselib.Std.Either.t
diff --git a/test/OMakefile b/test/OMakefile
index a2bad3b..7f82a38 100644
--- a/test/OMakefile
+++ b/test/OMakefile
@@ -1,106 +1,107 @@
-########################################################################
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this file, to deal in the File without
-# restriction, including without limitation the rights to use,
-# copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the File, and to permit persons to whom the
-# File is furnished to do so, subject to the following condition:
-#
-# THE FILE 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 FILE OR
-# THE USE OR OTHER DEALINGS IN THE FILE.
-
-########################################################################
-# The standard OMakefile.
-# You will usually need to modify this file for your project.
-open MyOCaml
-
-########################################################################
-# Phony targets are scoped, so you probably want to declare them first.
-#
-
-.PHONY: all test clean
-
-########################################################################
-# Subdirectories.
-# You may want to include some subdirectories in this project.
-# If so, define the subdirectory targets and uncomment this section.
-#
-
-# .SUBDIRS:
-
-################################################
-# Configuration.  You may want to modify any of these configuration
-# variables.
-#
-
-#
-# This project requires ocamlfind (default - false).
-#
-USE_OCAMLFIND = true
-#
-OCAMLPACKS[] =
-    oUnit
-    num
-#    pack1
-#    pack2
-#
-# if $(not $(OCAMLFIND_EXISTS))
-#    eprintln(This project requires ocamlfind, but is was not found.)
-#    eprintln(You need to install ocamlfind and run "omake --configure".)
-#    exit 1
-
-#
-# Include path
-#
-OCAMLINCLUDES += ../lib/baselib/build ../lib/vecmath/build ../src
-
-#
-# Compile native or byte code?
-#
-# The default values are defined as follows:
-#
-NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
-BYTE_ENABLED = true
-
-OCAML_LIBS += ../lib/baselib/build/baselib ../src/json_ocaml
-#
-# Various options
-#
-OCAMLFLAGS    += -annot -bin-annot -g
-# OCAMLCFLAGS   +=
-# OCAMLOPTFLAGS +=
-# OCAML_LINK_FLAGS +=
-# OCAML_BYTE_LINK_FLAGS +=
-# OCAML_NATIVE_LINK_FLAGS +=
-
-################################################
-# Build an OCaml library
-#
-
-FILES[] = $(removesuffix $(ls *ml))
-#    file1
-#    file2
-#
-
-PROGRAMS =
-	foreach(x, $(FILES))
-		value $(OCamlProgram $x, $x)
-
-test: $(PROGRAMS)
-	foreach(x, $(FILES))
-		./$x$(EXE)
-
-clean:
-	rm -f $(PROGRAMS)
-	rm -f *.annot
-	rm -f *.cmx
-	rm -f *.cmt
-	rm -f *.cmo
-	rm -f *.cmi
-	rm -f *.cmt
-	rm -f *.o
+########################################################################
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this file, to deal in the File without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the File, and to permit persons to whom the
+# File is furnished to do so, subject to the following condition:
+#
+# THE FILE 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 FILE OR
+# THE USE OR OTHER DEALINGS IN THE FILE.
+
+########################################################################
+# The standard OMakefile.
+# You will usually need to modify this file for your project.
+open MyOCaml
+
+########################################################################
+# Phony targets are scoped, so you probably want to declare them first.
+#
+
+.PHONY: all test clean
+
+########################################################################
+# Subdirectories.
+# You may want to include some subdirectories in this project.
+# If so, define the subdirectory targets and uncomment this section.
+#
+
+# .SUBDIRS:
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+
+#
+# This project requires ocamlfind (default - false).
+#
+USE_OCAMLFIND = true
+#
+OCAMLPACKS[] =
+    oUnit
+    num
+    str
+#    pack1
+#    pack2
+#
+# if $(not $(OCAMLFIND_EXISTS))
+#    eprintln(This project requires ocamlfind, but is was not found.)
+#    eprintln(You need to install ocamlfind and run "omake --configure".)
+#    exit 1
+
+#
+# Include path
+#
+OCAMLINCLUDES += ../lib/baselib/build ../lib/vecmath/build ../src
+
+#
+# Compile native or byte code?
+#
+# The default values are defined as follows:
+#
+NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+BYTE_ENABLED = true
+
+OCAML_LIBS += ../lib/baselib/build/baselib ../src/json_ocaml
+#
+# Various options
+#
+OCAMLFLAGS    += -annot -bin-annot -g
+# OCAMLCFLAGS   +=
+# OCAMLOPTFLAGS +=
+# OCAML_LINK_FLAGS +=
+# OCAML_BYTE_LINK_FLAGS +=
+# OCAML_NATIVE_LINK_FLAGS +=
+
+################################################
+# Build an OCaml library
+#
+
+FILES[] = $(removesuffix $(ls *ml))
+#    file1
+#    file2
+#
+
+PROGRAMS =
+	foreach(x, $(FILES))
+		value $(OCamlProgram $x, $x)
+
+test: $(PROGRAMS)
+	foreach(x, $(FILES))
+		./$x$(EXE)
+
+clean:
+	rm -f $(PROGRAMS)
+	rm -f *.annot
+	rm -f *.cmx
+	rm -f *.cmt
+	rm -f *.cmo
+	rm -f *.cmi
+	rm -f *.cmt
+	rm -f *.o
diff --git a/test/test_json_decode.ml b/test/test_json_decode.ml
index ede1881..cb7e1e8 100644
--- a/test/test_json_decode.ml
+++ b/test/test_json_decode.ml
@@ -1,164 +1,164 @@
-open OUnit
-open Baselib.Std.Either
-module J = Json_ocaml.Json
-module T = Json_ocaml.Json.Type
-
-let assert_left m = function
-  | Left(_) -> ()
-  | Right(_) -> assert_failure m
-
-let assert_right m = function
-  | Left(_) -> assert_failure m
-  | Right(_) -> ()
-
-let assert_right_with m f = function
-  | Left(_) -> assert_failure m
-  | Right(r) -> f r
-;;
-
-let test_empty_object _ =
-  let o = J.decode "{}" in
-  assert_right "can not decode" o
-;;
-
-let test_one_object _ =
-  let o = J.decode "{\"test\":100}" in
-  assert_right_with "can not decode array having one element" (
-    function
-    | T.Object([("test", T.Number(100.0))]) -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-let test_multi_pair_in_an_object _ =
-  let o = J.decode "{\"test\":100,\"test2\":true,\"foo\":null}" in
-  assert_right_with "can not decode object having some elements" (
-    function
-    | T.Object([("test", T.Number(100.0));
-                ("test2", T.Bool(true));
-                ("foo", T.Null);
-               ]) -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-let test_empty_array _ =
-  let o = J.decode "[]" in
-  assert_right "can not decode empty array" o
-;;
-
-let test_one_array _ =
-  let o = J.decode "[\"hoge\"]" in
-  assert_right_with "can not decode array having one element" (
-    function
-    | T.Array([T.String("hoge")]) -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-let test_multi_array _ =
-  let o = J.decode "[\"hoge\",false,null,100.4, {\"test3\":\"value\"}]" in
-  assert_right_with "can not decode array having one element" (
-    function
-    | T.Array([T.String("hoge"); T.Bool(false);
-               T.Null; T.Number(100.4); T.Object([("test3", T.String("value"))])
-              ]) -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-
-let test_empty_string _ =
-  let o = J.decode "\"\"" in
-  assert_right_with "can not decode array having one element" (
-    function
-    | T.String("") -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-let test_normal_string _ =
-  let o = J.decode "\"foobar\"" in
-  assert_right_with "can not decode array having one element" (
-    function
-    | T.String("foobar") -> ()
-    | _ -> assert_failure "invalid pattern"
-  ) o
-;;
-
-
-let test_one_digit _ =
-  let o = J.decode "1" in
-  begin
-    match o with
-    | Right(T.Number(1.0)) -> ()
-    | _ -> assert_failure "can not decode"
-  end;
-  let o = J.decode "100" in
-  begin
-    match o with
-    | Right(T.Number(100.0)) -> ()
-    | _ -> assert_failure "can not decode"
-  end;
-  let o = J.decode "00" in
-  begin
-    match o with
-    | Right(T.Number(0.0)) -> ()
-    | _ -> assert_failure "can not decode"
-  end;
-;;
-
-let test_float_digit _ =
-  let assert_float json f =
-    match json with
-    | Right(T.Number(s)) -> assert_equal s f ~msg:("float " ^ (string_of_float s))
-    | _ -> assert_failure "can not decode" in
-  let o = J.decode "1e104" in
-  assert_float o 1e104;
-  let o = J.decode "1.04032" in
-  assert_float o 1.04032;
-  let o = J.decode "0.14e10" in
-  assert_float o 1.4e9;
-  let o = J.decode "-1.5" in
-  assert_float o (-1.5);
-  let o = J.decode "1." in
-  assert_float o 1.0
-;;
-
-let test_constants _ =
-  let o = J.decode "null" in
-  begin
-    match o with
-    | Right(T.Null) -> ()
-    | _ -> assert_failure "can not decode"
-  end;
-  let o = J.decode "true" in
-  begin
-    match o with
-    | Right(T.Bool(true)) -> ()
-    | _ -> assert_failure "can not decode"
-  end;
-  let o = J.decode "false" in
-  begin
-    match o with
-    | Right(T.Bool(false)) -> ()
-    | _ -> assert_failure "can not decode"
-  end
-;;
-
-let suite = "JSON decode" >::: [
-  "empty object" >:: test_empty_object;
-  "one object" >:: test_one_object;
-  "multi pair in object" >:: test_multi_pair_in_an_object;
-  "empty array" >:: test_empty_array;
-  "one string array" >:: test_one_array;
-  "containing multi values in array" >:: test_multi_array;
-  "empty string" >:: test_empty_string;
-  "normal string" >:: test_normal_string;
-  "one digit" >:: test_one_digit;
-  "floats" >:: test_float_digit;
-  "constants" >:: test_constants;
-]
-
-let _ =
-  run_test_tt_main suite
+open OUnit
+open Baselib.Std.Either
+module J = Json_ocaml.Json
+module T = Json_ocaml.Json.Type
+
+let assert_left m = function
+  | Left(_) -> ()
+  | Right(_) -> assert_failure m
+
+let assert_right m = function
+  | Left(_) -> assert_failure m
+  | Right(_) -> ()
+
+let assert_right_with m f = function
+  | Left(_) -> assert_failure m
+  | Right(r) -> f r
+;;
+
+let test_empty_object _ =
+  let o = J.decode "{}" in
+  assert_right "can not decode" o
+;;
+
+let test_one_object _ =
+  let o = J.decode "{\"test\":100}" in
+  assert_right_with "can not decode array having one element" (
+    function
+    | T.Object([("test", T.Number(100.0))]) -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+let test_multi_pair_in_an_object _ =
+  let o = J.decode "{\"test\":100,\"test2\":true,\"foo\":null}" in
+  assert_right_with "can not decode object having some elements" (
+    function
+    | T.Object([("test", T.Number(100.0));
+                ("test2", T.Bool(true));
+                ("foo", T.Null);
+               ]) -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+let test_empty_array _ =
+  let o = J.decode "[]" in
+  assert_right "can not decode empty array" o
+;;
+
+let test_one_array _ =
+  let o = J.decode "[\"hoge\"]" in
+  assert_right_with "can not decode array having one element" (
+    function
+    | T.Array([T.String("hoge")]) -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+let test_multi_array _ =
+  let o = J.decode "[\"hoge\",false,null,100.4, {\"test3\":\"value\"}]" in
+  assert_right_with "can not decode array having one element" (
+    function
+    | T.Array([T.String("hoge"); T.Bool(false);
+               T.Null; T.Number(100.4); T.Object([("test3", T.String("value"))])
+              ]) -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+
+let test_empty_string _ =
+  let o = J.decode "\"\"" in
+  assert_right_with "can not decode array having one element" (
+    function
+    | T.String("") -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+let test_normal_string _ =
+  let o = J.decode "\"foobar\"" in
+  assert_right_with "can not decode array having one element" (
+    function
+    | T.String("foobar") -> ()
+    | _ -> assert_failure "invalid pattern"
+  ) o
+;;
+
+
+let test_one_digit _ =
+  let o = J.decode "1" in
+  begin
+    match o with
+    | Right(T.Number(1.0)) -> ()
+    | _ -> assert_failure "can not decode"
+  end;
+  let o = J.decode "100" in
+  begin
+    match o with
+    | Right(T.Number(100.0)) -> ()
+    | _ -> assert_failure "can not decode"
+  end;
+  let o = J.decode "00" in
+  begin
+    match o with
+    | Right(T.Number(0.0)) -> ()
+    | _ -> assert_failure "can not decode"
+  end;
+;;
+
+let test_float_digit _ =
+  let assert_float json f =
+    match json with
+    | Right(T.Number(s)) -> assert_equal s f ~msg:("float " ^ (string_of_float s))
+    | _ -> assert_failure "can not decode" in
+  let o = J.decode "1e104" in
+  assert_float o 1e104;
+  let o = J.decode "1.04032" in
+  assert_float o 1.04032;
+  let o = J.decode "0.14e10" in
+  assert_float o 1.4e9;
+  let o = J.decode "-1.5" in
+  assert_float o (-1.5);
+  let o = J.decode "1." in
+  assert_left "the string '1.' can not decode to 1.0" o
+;;
+
+let test_constants _ =
+  let o = J.decode "null" in
+  begin
+    match o with
+    | Right(T.Null) -> ()
+    | _ -> assert_failure "can not decode"
+  end;
+  let o = J.decode "true" in
+  begin
+    match o with
+    | Right(T.Bool(true)) -> ()
+    | _ -> assert_failure "can not decode"
+  end;
+  let o = J.decode "false" in
+  begin
+    match o with
+    | Right(T.Bool(false)) -> ()
+    | _ -> assert_failure "can not decode"
+  end
+;;
+
+let suite = "JSON decode" >::: [
+  "empty object" >:: test_empty_object;
+  "one object" >:: test_one_object;
+  "multi pair in object" >:: test_multi_pair_in_an_object;
+  "empty array" >:: test_empty_array;
+  "one string array" >:: test_one_array;
+  "containing multi values in array" >:: test_multi_array;
+  "empty string" >:: test_empty_string;
+  "normal string" >:: test_normal_string;
+  "one digit" >:: test_one_digit;
+  "floats" >:: test_float_digit;
+  "constants" >:: test_constants;
+]
+
+let _ =
+  run_test_tt_main suite
diff --git a/test/test_json_encode.ml b/test/test_json_encode.ml
index 67ef48a..f57cee6 100644
--- a/test/test_json_encode.ml
+++ b/test/test_json_encode.ml
@@ -1,56 +1,56 @@
-open OUnit
-open Baselib.Std.Either
-module J = Json_ocaml.Json
-module T = Json_ocaml.Json.Type
-
-let test_empty_object _ =
-  let json = T.Object([]) in
-  assert_equal "{}" (J.encode json)
-;;
-
-let test_empty_array _ =
-  let json = T.Array([]) in
-  assert_equal "[]" (J.encode json)
-;;
-
-let test_constants _ =
-  let json = T.Bool(true) in
-  assert_equal "true" (J.encode json);
-  let json = T.Bool(false) in
-  assert_equal "false" (J.encode json);
-  let json = T.Null in
-  assert_equal "null" (J.encode json)
-;;
-
-let test_encode_number _ =
-  let json = T.Number(1.0) in
-  assert_equal "1.0" (J.encode json);
-  let json = T.Number(100.0) in
-  assert_equal "100.0" (J.encode json);
-  let json = T.Number(0.1234) in
-  assert_equal "0.1234" (J.encode json);
-;;
-
-let test_encode_string _ =
-  let json = T.String("") in
-  assert_equal "\"\"" (J.encode json);
-  let json = T.String("a") in
-  assert_equal "\"a\"" (J.encode json);
-  let json = T.String("foo bar") in
-  assert_equal "\"foo bar\"" (J.encode json);
-  let json = T.String("foo \b\t\r\nbar") in
-  assert_equal "\"foo \\b\\r\\r\\nbar\"" (J.encode json);
-  let json = T.String("日本語english混在テスト") in
-  assert_equal "\"日本語english混在テスト\"" (J.encode json) ~msg:"english and japanese mixin test";
-;;
-
-let suite = "JSON encode" >::: [
-  "empty object" >:: test_empty_object;
-  "empty array" >:: test_empty_array;
-  "encode single types" >:: test_constants;
-  "encode number" >:: test_encode_number;
-  "encode string" >:: test_encode_string;
-]
-
-let _ =
-  run_test_tt_main suite
+open OUnit
+open Baselib.Std.Either
+module J = Json_ocaml.Json
+module T = Json_ocaml.Json.Type
+
+let test_empty_object _ =
+  let json = T.Object([]) in
+  assert_equal "{}" (J.encode json)
+;;
+
+let test_empty_array _ =
+  let json = T.Array([]) in
+  assert_equal "[]" (J.encode json)
+;;
+
+let test_constants _ =
+  let json = T.Bool(true) in
+  assert_equal "true" (J.encode json);
+  let json = T.Bool(false) in
+  assert_equal "false" (J.encode json);
+  let json = T.Null in
+  assert_equal "null" (J.encode json)
+;;
+
+let test_encode_number _ =
+  let json = T.Number(1.0) in
+  assert_equal "1.0" (J.encode json);
+  let json = T.Number(100.0) in
+  assert_equal "100.0" (J.encode json);
+  let json = T.Number(0.1234) in
+  assert_equal "0.1234" (J.encode json);
+;;
+
+let test_encode_string _ =
+  let json = T.String("") in
+  assert_equal "\"\"" (J.encode json);
+  let json = T.String("a") in
+  assert_equal "\"a\"" (J.encode json);
+  let json = T.String("foo bar") in
+  assert_equal "\"foo bar\"" (J.encode json);
+  let json = T.String("foo \b\t\r\nbar") in
+  assert_equal "\"foo \b\t\r\nbar\"" (J.encode json);
+  let json = T.String("日本語english混在テスト") in
+  assert_equal "\"日本語english混在テスト\"" (J.encode json) ~msg:"english and japanese mixin test";
+;;
+
+let suite = "JSON encode" >::: [
+  "empty object" >:: test_empty_object;
+  "empty array" >:: test_empty_array;
+  "encode single types" >:: test_constants;
+  "encode number" >:: test_encode_number;
+  "encode string" >:: test_encode_string;
+]
+
+let _ =
+  run_test_tt_main suite
[from now] 2013/05/01 17:49:15

diff --git a/test/test_json_encode.ml b/test/test_json_encode.ml
index f57cee6..02aa8ce 100644
--- a/test/test_json_encode.ml
+++ b/test/test_json_encode.ml
@@ -8,11 +8,31 @@ let test_empty_object _ =
   assert_equal "{}" (J.encode json)
 ;;

+let test_encode_object _ =
+  let json = T.Object([("hoge",T.Bool(true))]) in
+  assert_equal "{\"hoge\":true}" (J.encode json);
+  let json = T.Object([("hoge",T.Array([T.Number(1.0)]))]) in
+  assert_equal "{\"hoge\":[1.0]}" (J.encode json);
+  let json = T.Object([("hoge",T.Object([("foobar", T.Number(100.0))]))]) in
+  assert_equal "{\"hoge\":{\"foobar\":100.0}}" (J.encode json);
+;;
+
 let test_empty_array _ =
   let json = T.Array([]) in
   assert_equal "[]" (J.encode json)
 ;;

+let test_encode_array _ =
+  let json = T.Array([T.Bool(true);T.Null]) in
+  assert_equal "[true,null]" (J.encode json);
+  let json = T.Array([T.Array([T.Number(1.0)]);T.String("hoge")]) in
+  assert_equal "[[1.0],\"hoge\"]" (J.encode json);
+  let json = T.Array([T.Object([("hoge",T.Number(100.0))]);
+                      T.Object([("foobar", T.Bool(false))])
+                     ]) in
+  assert_equal "[{\"hoge\":100.0},{\"foobar\":false}]" (J.encode json);
+;;
+
 let test_constants _ =
   let json = T.Bool(true) in
   assert_equal "true" (J.encode json);
@@ -46,7 +66,9 @@ let test_encode_string _ =

 let suite = "JSON encode" >::: [
   "empty object" >:: test_empty_object;
+  "encode some objects" >:: test_encode_object;
   "empty array" >:: test_empty_array;
+  "encode some arrays" >:: test_encode_array;
   "encode single types" >:: test_constants;
   "encode number" >:: test_encode_number;
   "encode string" >:: test_encode_string;