2011-07-27 07:17:02 -07:00
|
|
|
# -*- Makefile -*-
|
|
|
|
|
2016-02-18 07:11:59 -08:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
|
|
|
|
#* *
|
|
|
|
#* Copyright 2002 Institut National de Recherche en Informatique et *
|
|
|
|
#* en Automatique. *
|
|
|
|
#* *
|
|
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
2011-07-27 07:17:02 -07:00
|
|
|
|
|
|
|
# This file lists all standard library modules.
|
2020-05-11 03:21:59 -07:00
|
|
|
# It is used by:
|
|
|
|
# 1. stdlib/Makefile when building stdlib.cma
|
|
|
|
# 2. Makefile to expunge the toplevels
|
|
|
|
# 3. ocamldoc/Makefile.docfiles to compute all documentation files
|
|
|
|
# which need to be generated for the stdlib
|
2011-07-27 07:17:02 -07:00
|
|
|
|
2020-05-11 03:21:59 -07:00
|
|
|
# add stdlib__ as prefix to a module except for internal modules
|
|
|
|
# and the stdlib module itself
|
|
|
|
define add_stdlib_prefix
|
|
|
|
$(or $(filter stdlib camlinternal%,$1), stdlib__$1)
|
|
|
|
endef
|
2017-01-12 03:56:24 -08:00
|
|
|
|
2019-09-29 02:07:50 -07:00
|
|
|
# Modules should be listed in dependency order.
|
2020-05-11 03:21:59 -07:00
|
|
|
STDLIB_MODS=\
|
2020-06-09 14:51:58 -07:00
|
|
|
camlinternalFormatBasics camlinternalAtomic \
|
Add `'a Either.t = Left of 'a | Right of 'b`
```ocaml
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val equal :
left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
('a, 'b) t -> ('a, 'b) t -> bool
val compare :
left:('a -> 'a -> int) -> right:('b -> 'b -> int) ->
('a, 'b) t -> ('a, 'b) t -> int
```
Unlike [result], no [either] type is made available in Stdlib,
one needs to access [Either.t] explicitly:
- This type is less common in typical OCaml codebases,
which prefer domain-specific variant types whose constructors
carry more meaning.
- Adding this to Stdlib would raise warnings in existing codebases
that already use a constructor named Left or Right:
+ when opening a module that exports such a name,
warning 45 is raised
+ adding a second constructor of the same name in scope kicks
in the disambiguation mechanisms, and warning 41 may now
be raised by existing code.
If the use becomes more common in the future we can always
revisit this choice.
2019-10-20 02:00:22 -07:00
|
|
|
stdlib pervasives seq option either result bool char uchar \
|
2020-05-11 03:21:59 -07:00
|
|
|
sys list bytes string unit marshal obj array float int int32 int64 nativeint \
|
|
|
|
lexing parsing set map stack queue camlinternalLazy lazy stream buffer \
|
2020-06-09 14:51:58 -07:00
|
|
|
camlinternalFormat printf arg atomic \
|
|
|
|
printexc fun gc digest random hashtbl weak \
|
2020-05-11 03:21:59 -07:00
|
|
|
format scanf callback camlinternalOO oo camlinternalMod genlex ephemeron \
|
|
|
|
filename complex arrayLabels listLabels bytesLabels stringLabels moreLabels \
|
2020-10-08 06:19:31 -07:00
|
|
|
stdLabels bigarray
|
2019-09-29 02:07:50 -07:00
|
|
|
|
2002-11-17 08:42:12 -08:00
|
|
|
STDLIB_MODULES=\
|
2020-05-11 03:21:59 -07:00
|
|
|
$(foreach module, $(STDLIB_MODS), $(call add_stdlib_prefix,$(module)))
|