UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

56 lines 1.3 kB
import * as D from './Decoder'; import * as Eq from './Eq'; import * as G from './Guard'; import { memoize, } from './Schemable'; // ------------------------------------------------------------------------------------- // constructors // ------------------------------------------------------------------------------------- /** * @category Constructor * @since 0.9.4 */ export function make(schema) { return memoize(schema); } /** * @category Constructor * @since 0.9.5 */ export function withRefine(schema) { return memoize(schema); } /** * @category Constructor * @since 0.9.5 */ export function withUnion(schema) { return memoize(schema); } /** * @category Constructor * @since 0.9.5 */ export function create(schema) { return memoize(schema); } /** * @since 0.9.4 * @category Combinator */ export const interpret = ((schemable) => (schema) => schema(schemable)); /** * @since 0.9.5 * @category Combinator */ export const toDecoder = interpret({ ...D.Schemable, ...D.WithUnion, ...D.WithRefine }); /** * @since 0.9.5 * @category Combinator */ export const toEq = interpret(Eq.Schemable); /** * @since 0.9.5 * @category Combinator */ export const toGuard = interpret({ ...G.Schemable, ...G.WithUnion, ...G.WithRefine }); //# sourceMappingURL=Schema.js.map