11.18.08
Batteries: reworking the hierarchy (feedback wanted)
As readers interested in OCaml may know, we’ve been working for several months of OCaml Batteries Included. Early in the development, it appeared to us that, with the large number of modules involved, we would need a hierarchy of modules.
For instance, for the moment, we have a module System containing among other submodules IO (definition of i/o operations), File (definition of operations on files), Sys (the usual OCaml Sys module, soon to be expanded), etc. Therefore, before one may open and manipulate files, one has to do
open System.IO;; open System.File;;
or, with the syntax extension we developed to alleviate this,
open System, IO, File;;
the syntax extension does a few other things which we’re not going to detail here — for one thing, it allows local opening of modules).
Now that we’ve reached Alpha 2 and are well on our way towards Alpha 3, we’ve decided that it’s time to rework our current hierarchy and make it shorter and more consistent. Before we proceed, we’d like some feedback from the community. Discussion will take place mostly on the OCaml mailing-list and on irc (server: Freenode, channel: #ocaml) but I preferred posting the hierarchy here for easier reading.
At the moment, our hierarchy looks roughly as follows:
Batteries (automatically opened)
- Control
- Concurrency
- Common
- Threads
- Condition
- Event
- Mutex
- Thread
- Exceptions
- Return
- Monad
- Concurrency
- Data
- Containers (common interfaces)
- Mutable
- Array
- Cap
- Labels
- ExceptionLess
- Labels
- ExceptionLess
- Cap
- Bigarray
- Array1
- Array2
- Array3
- Genarray
- Dllist
- Dynarray
- Enum
- ExceptionLess
- Global
- Hashtbl
- Make
- Labels
- ExceptionLess
- Make
- RefList
- Index
- Queue
- Ref
- RefList
- Stack
- Stream
- Array
- Logical
- Bool
- BitSet
- Numeric
- Big_int
- Common
- Complex
- Float
- Int
- Int32
- Int64
- Native_int
- Num
- Safe_int
- Unit
- Common
- Persistent
- Lazy
- List
- ExceptionLess
- Labels
- Map
- Make
- ExceptionLess
- Labels
- Make
- Option
- Labels
- PMap
- PSet
- Set
- Make
- ExceptionLess
- Labels
- Make
- Text
- Buffer
- Char
- UTF8
- Rope
- UChar
- String
- ExceptionLess
- Labels
- Languages
- CharParser
- Genlex
- Languages
- Library
- C
- OCaml
- Library
- Languages
- Format
- Lexing
- ParserCo
- Source
- Parsing
- Printf
- Scanf
- Scanning
- SExpr
- Str
- Meta
- Callback
- CamlinternalMod
- CamlinternalOo
- Gc
- Obj
- Oo
- Weak
- Make
- Standard (automatically opened)
- System
- Arg
- Compress
- GZip
- File
- Filename
- IO
- BigEndian
- Network (placeholder)
- OptParse
- Opt
- OptParser
- StdOpt
- Unix
- Labels
- Sys
- Toolchain
- Execute
- Findlib
- Util
- Digest
- Random
- State
- Legacy
One possible replacement has been drafted:
- Control
- Concurrency
- Common
- Threads
- Condition
- Event
- Mutex
- Thread
- Exceptions
- Return
- Monad
- Concurrency
- Data
- Containers
- Common
- Array
- Cap
- ExceptionLess
- Labels
- ExceptionLess
- Labels
- Cap
- Bigarray
- Array1
- Array2
- Array3
- Genarray
- Dllist
- Dynarray
- Enum
- ExceptionLess
- Labels
- Global
- Hashtbl
- Make
- ExceptionLess
- Labels
- Make
- Lazy
- List
- ExceptionLess
- Labels
- Map
- Make
-
- ExceptionLess
- Labels
- Option
- Labels
- PMap
- PSet
- RefList
- Index
- Queue
- Ref
- RefList
- Set
- Make
- ExceptionLess
- Labels
- Stack
- Stream
- Logical
- Bool
- BitSet
- Unit
- Numeric
- Interfaces (formerly Common)
- Big_int
- Common
- Complex
- Float
- Int
- Int32
- Int64
- Native_int
- Num
- Safe_int
- Text
- Buffer
- Char
- UTF8
- Rope
- UChar
- String
- Labels
- Containers
- Distro
- Packages (formerly Findlib)
- Tools (formerly Execute)
- Internals
- Callback
- Gc
- Mod (formerly CamlinternalMod)
- Obj
- Oo
- Private (formerly CamlinternalOo)
- Weak
- Make
- IO
- BigEndian
- Gzip
- Bz2
- Zip
- Transcode (placeholder)
- Network (placeholder)
- Text (formerly Languages)
- Lex
- Genlex
- Languages
- C
- OCaml
- Languages
- Lexing
- Genlex
- Parse
- CharParser
- UCharParser
- ParserCo
- Source
- Parsing
- Pretty
- Format
- Printf
- Regexp
- Str
- PCRE (in the future)
- Scanf
- Scanning
- SExpr
- XML (placeholder)
- Lex
- Standard (automatically opened)
- Sys
- Arg
- File
- OptParse
- Opt
- OptParser
- StdOpt
- Path (formerly Filename)
- Shell (formerly Sys)
- Unix
- Labels
- Util
- Digest
- Random
- State
- Legacy
The overall goal, with this new version, is to make for
- a shallower hierarchy
- shorter module names
- more consistent groups of modules.
What do you think of this replacement? Is it any better?