-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdo_types.hrl
More file actions
46 lines (34 loc) · 1.36 KB
/
Copy pathdo_types.hrl
File metadata and controls
46 lines (34 loc) · 1.36 KB
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
%%%_* types -------------------------------------------------------------------
-type either(A, B) :: {error, A} | {ok, B}.
-type fn(A, B) :: fun((A) -> B).
-type map(A) :: #{_ := A}.
-type 'maybe'(A) :: {just, A} | nothing.
%%%_* type classes ------------------------------------------------------------
-type applicative(A) :: [A]
| fn(_, A)
| either(_, A)
| 'maybe'(A).
-type foldable(A) :: [A]
| 'maybe'(A)
| either(_, A).
-type functor(A) :: [A]
| map(A)
| fn(_, A)
| either(_, A)
| 'maybe'(A).
-type monad(A) :: [A]
| either(_, A)
| 'maybe'(A).
-type monoid() :: [monoid()]
| 'maybe'(monoid())
| either(_, monoid()).
-type semigroup(A) :: [A]
| map(A)
| either(_, A)
| 'maybe'(A).
-type traversable(A) :: [A]
| either(_, A)
| 'maybe'(A).
%%%_* other -------------------------------------------------------------------
-type fn(A) :: fun(() -> A).
-type fn(A, B, C) :: fun((A, B) -> C).