@konker.dev/effect-ts-prelude
v0.0.18
Published
Prelude for Effect-ts
Downloads
9
Readme
@konker.dev/effect-ts-prelude
A prelude to conveniently import commonly used modules from Effect-TS
Example Usage
import * as P from '@konkerdotdev/effect-ts-prelude';
export function strToNum(s: string): P.Effect.Effect<never, Error, number> {
return P.pipe(s, P.Schema.decode(P.Schema.NumberFromString), P.Effect.mapError(P.toError));
}
P.assert(P.Effect.runSync(strToNum('1')) === 1);