merge from master

This commit is contained in:
Simon Cruanes 2014-06-28 04:07:12 +02:00
commit c2a2e9e0a5
3 changed files with 9 additions and 4 deletions

View file

@ -52,8 +52,8 @@ structures comprise (some modules in `misc/`, some other in `core/`):
- `CCPersistentHashtbl`, a semi-persistent hashtable (similar to [persistent arrays](https://www.lri.fr/~filliatr/ftp/ocaml/ds/parray.ml.html)) - `CCPersistentHashtbl`, a semi-persistent hashtable (similar to [persistent arrays](https://www.lri.fr/~filliatr/ftp/ocaml/ds/parray.ml.html))
- `CCVector`, a growable array (pure OCaml, no C) with mutability annotations - `CCVector`, a growable array (pure OCaml, no C) with mutability annotations
- `CCGen` and `CCSequence`, generic iterators structures (with structural types so they can be defined in several places). Now also in their own repository and opam packages (`gen` and `sequence`). - `CCGen` and `CCSequence`, generic iterators structures (with structural types so they can be defined in several places). Now also in their own repository and opam packages (`gen` and `sequence`).
- `CCKlist`, a persistent iterator structure (akin to a lazy list) - `CCKList`, a persistent iterator structure (akin to a lazy list)
- `CCList`, functions and lists including tail-recursive implementations of `map` and `append` and many other utilities - `CCList`, functions on lists, including tail-recursive implementations of `map` and `append` and many other things
- `CCArray`, utilities on arrays and slices - `CCArray`, utilities on arrays and slices
- `CCLinq`, high-level query language over collections - `CCLinq`, high-level query language over collections
- `CCMultimap` and `CCMultiset`, functors defining persistent structures - `CCMultimap` and `CCMultiset`, functors defining persistent structures
@ -62,14 +62,14 @@ structures comprise (some modules in `misc/`, some other in `core/`):
- `CCInt` - `CCInt`
- `CCString` (basic string operations) - `CCString` (basic string operations)
- `CCPair` (cartesian products) - `CCPair` (cartesian products)
- `CCOpt` (options) - `CCOpt` (options, very useful)
- `CCFun` (function combinators) - `CCFun` (function combinators)
- `CCBool` - `CCBool`
- `CCOrd` (combinators for total orderings) - `CCOrd` (combinators for total orderings)
- `CCRandom` (combinators for random generators) - `CCRandom` (combinators for random generators)
- `CCPrint` (printing combinators) - `CCPrint` (printing combinators)
- `CCHash` (hashing combinators) - `CCHash` (hashing combinators)
- `CCError` (monadic error handling) - `CCError` (monadic error handling, very useful)
### String ### String

View file

@ -64,6 +64,8 @@ let flat_map f o = match o with
| None -> None | None -> None
| Some x -> f x | Some x -> f x
let pure x = Some x
let (<*>) f x = match f, x with let (<*>) f x = match f, x with
| None, _ | None, _
| _, None -> None | _, None -> None

View file

@ -68,6 +68,9 @@ val sequence_l : 'a t list -> 'a list t
(** {2 Applicative} *) (** {2 Applicative} *)
val pure : 'a -> 'a t
(** Alias to {!return} *)
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t val (<*>) : ('a -> 'b) t -> 'a t -> 'b t
val (<$>) : ('a -> 'b) -> 'a t -> 'b t val (<$>) : ('a -> 'b) -> 'a t -> 'b t