package alba

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file module_types.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
module type ANY =
  sig
    type t
  end



module type SORTABLE =
  sig
    type t
    val compare: t -> t -> int
  end



module type FUNCTOR =
  sig
    type 'a t
    val return: 'a -> 'a t
    val map:    ('a -> 'b) -> 'a t -> 'b t
  end

module type APPLICATIVE =
  sig
    type 'a t
    val return: 'a -> 'a t
    val map:    ('a -> 'b) -> 'a t -> 'b t
    val (<*>):  ('a -> 'b) t -> 'a t -> 'b t
  end


module type MONAD0 =
sig
    type _ t
    val return: 'a -> 'a t
    val (>>=):  'a t -> ('a -> 'b t) -> 'b t
end



module type MONAD =
  sig
    type 'a t
    val return: 'a -> 'a t
    val (>>=):  'a t -> ('a -> 'b t) -> 'b t
    val (>=>):  ('a -> 'b t) -> ('b -> 'c t) -> ('a -> 'c t)
    val map:  ('a -> 'b) -> 'a t -> 'b t
    val join: 'a t t -> 'a t
    val (<*>): ('a -> 'b) t -> 'a t -> 'b t
  end


module type READABLE =
  sig
    type t
    val has_more: t -> bool
    val peek: t -> char
    val advance: t -> t
  end




module type WRITABLE =
  sig
    type t
    val needs_more: t -> bool
    val put_character: t -> char ->  t
    val put_end: t -> t
  end
OCaml

Innovation. Community. Security.