1 |
|
2 |
|
3 |
|
4 | import { Either } from './Either';
|
5 | import { IO } from './IO';
|
6 | import { IOEither } from './IOEither';
|
7 | import { Monad4 } from './Monad';
|
8 | import { Reader } from './Reader';
|
9 | import { ReaderEither } from './ReaderEither';
|
10 | import * as RTE from './ReaderTaskEither';
|
11 | import { State } from './State';
|
12 | import { Task } from './Task';
|
13 | import { TaskEither } from './TaskEither';
|
14 | import ReaderTaskEither = RTE.ReaderTaskEither;
|
15 | import { MonadThrow4 } from './MonadThrow';
|
16 | declare module './HKT' {
|
17 | interface URItoKind4<S, R, E, A> {
|
18 | StateReaderTaskEither: StateReaderTaskEither<S, R, E, A>;
|
19 | }
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | export declare const URI = "StateReaderTaskEither";
|
25 |
|
26 |
|
27 |
|
28 | export declare type URI = typeof URI;
|
29 |
|
30 |
|
31 |
|
32 | export interface StateReaderTaskEither<S, R, E, A> {
|
33 | (s: S): ReaderTaskEither<R, E, [A, S]>;
|
34 | }
|
35 |
|
36 |
|
37 |
|
38 | export declare function run<S, R, E, A>(ma: StateReaderTaskEither<S, R, E, A>, s: S, r: R): Promise<Either<E, [A, S]>>;
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | export declare const evalState: <S, R, E, A>(ma: StateReaderTaskEither<S, R, E, A>, s: S) => ReaderTaskEither<R, E, A>;
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export declare const execState: <S, R, E, A>(ma: StateReaderTaskEither<S, R, E, A>, s: S) => ReaderTaskEither<R, E, S>;
|
51 |
|
52 |
|
53 |
|
54 | export declare function left<S, R, E = never, A = never>(e: E): StateReaderTaskEither<S, R, E, A>;
|
55 |
|
56 |
|
57 |
|
58 | export declare const right: <S, R, E = never, A = never>(a: A) => StateReaderTaskEither<S, R, E, A>;
|
59 |
|
60 |
|
61 |
|
62 | export declare function rightTask<S, R, E = never, A = never>(ma: Task<A>): StateReaderTaskEither<S, R, E, A>;
|
63 |
|
64 |
|
65 |
|
66 | export declare function leftTask<S, R, E = never, A = never>(me: Task<E>): StateReaderTaskEither<S, R, E, A>;
|
67 |
|
68 |
|
69 |
|
70 | export declare function fromTaskEither<S, R, E, A>(ma: TaskEither<E, A>): StateReaderTaskEither<S, R, E, A>;
|
71 |
|
72 |
|
73 |
|
74 | export declare function rightReader<S, R, E = never, A = never>(ma: Reader<R, A>): StateReaderTaskEither<S, R, E, A>;
|
75 |
|
76 |
|
77 |
|
78 | export declare function leftReader<S, R, E = never, A = never>(me: Reader<R, E>): StateReaderTaskEither<S, R, E, A>;
|
79 |
|
80 |
|
81 |
|
82 | export declare function fromIOEither<S, R, E, A>(ma: IOEither<E, A>): StateReaderTaskEither<S, R, E, A>;
|
83 |
|
84 |
|
85 |
|
86 | export declare function fromReaderEither<S, R, E, A>(ma: ReaderEither<R, E, A>): StateReaderTaskEither<S, R, E, A>;
|
87 |
|
88 |
|
89 |
|
90 | export declare function rightIO<S, R, E = never, A = never>(ma: IO<A>): StateReaderTaskEither<S, R, E, A>;
|
91 |
|
92 |
|
93 |
|
94 | export declare function leftIO<S, R, E = never, A = never>(me: IO<E>): StateReaderTaskEither<S, R, E, A>;
|
95 |
|
96 |
|
97 |
|
98 | export declare const rightState: <S, R, E = never, A = never>(ma: State<S, A>) => StateReaderTaskEither<S, R, E, A>;
|
99 |
|
100 |
|
101 |
|
102 | export declare function leftState<S, R, E = never, A = never>(me: State<S, E>): StateReaderTaskEither<S, R, E, A>;
|
103 |
|
104 |
|
105 |
|
106 | export declare const fromReaderTaskEither: <S, R, E, A>(ma: ReaderTaskEither<R, E, A>) => StateReaderTaskEither<S, R, E, A>;
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | export declare const get: <S, R, E = never>() => StateReaderTaskEither<S, R, E, S>;
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | export declare const put: <S, R, E = never>(s: S) => StateReaderTaskEither<S, R, E, void>;
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 | export declare const modify: <S, R, E = never>(f: (s: S) => S) => StateReaderTaskEither<S, R, E, void>;
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | export declare const gets: <S, R, E = never, A = never>(f: (s: S) => A) => StateReaderTaskEither<S, R, E, A>;
|
131 |
|
132 |
|
133 |
|
134 | export declare const stateReaderTaskEither: Monad4<URI> & MonadThrow4<URI>;
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | export declare const stateReaderTaskEitherSeq: typeof stateReaderTaskEither;
|
140 | declare const ap: <S, R, E, A>(fa: StateReaderTaskEither<S, R, E, A>) => <B>(fab: StateReaderTaskEither<S, R, E, (a: A) => B>) => StateReaderTaskEither<S, R, E, B>, apFirst: <S, R, E, B>(fb: StateReaderTaskEither<S, R, E, B>) => <A>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>, apSecond: <S, R, E, B>(fb: StateReaderTaskEither<S, R, E, B>) => <A>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>, chain: <S, R, E, A, B>(f: (a: A) => StateReaderTaskEither<S, R, E, B>) => (ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>, chainFirst: <S, R, E, A, B>(f: (a: A) => StateReaderTaskEither<S, R, E, B>) => (ma: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, A>, flatten: <S, R, E, A>(mma: StateReaderTaskEither<S, R, E, StateReaderTaskEither<S, R, E, A>>) => StateReaderTaskEither<S, R, E, A>, map: <A, B>(f: (a: A) => B) => <S, R, E>(fa: StateReaderTaskEither<S, R, E, A>) => StateReaderTaskEither<S, R, E, B>, fromEither: <S, R, E, A>(ma: Either<E, A>) => StateReaderTaskEither<S, R, E, A>, fromOption: <E>(onNone: () => E) => <S, R, A>(ma: import("./Option").Option<A>) => StateReaderTaskEither<S, R, E, A>;
|
141 | export {
|
142 |
|
143 |
|
144 |
|
145 | ap,
|
146 |
|
147 |
|
148 |
|
149 | apFirst,
|
150 |
|
151 |
|
152 |
|
153 | apSecond,
|
154 |
|
155 |
|
156 |
|
157 | chain,
|
158 |
|
159 |
|
160 |
|
161 | chainFirst,
|
162 |
|
163 |
|
164 |
|
165 | flatten,
|
166 |
|
167 |
|
168 |
|
169 | map,
|
170 |
|
171 |
|
172 |
|
173 | fromEither,
|
174 |
|
175 |
|
176 |
|
177 | fromOption };
|