UNPKG

@parischap/pretty-print

Version:
15 lines 788 B
/** This module implements a Type that represents an array of ByPasser's (see ByPasser.ts) */ import { MArray } from '@parischap/effect-lib'; import { Array, Function, pipe } from 'effect'; /** * Returns a ByPasser that is equivalent to `self`. The returned ByPasser executes successively each * ByPasser of `self` until it meets one that returns a `some`. If such a ByPasser exists, the * corresponding `some` is returned. Otherwise, it returns a `none`. * * @category Destructors */ export const toSyntheticByPasser = self => function (constructors) { const initializedByPassers = Array.map(self, byPasser => byPasser.call(this, constructors)); return value => pipe(initializedByPassers, MArray.firstSomeResult(Function.apply(value))); }; //# sourceMappingURL=ByPassers.js.map