UNPKG

@typed/io

Version:

Runtime IO type system

9 lines 382 B
import { isObject } from '@typed/logic'; import { fromJust, isJust, isNothing } from '@typed/maybe'; import { refinement } from './refinement'; const _Maybe = { is: (u) => (isObject(u) && isNothing(u)) || isJust(u), }; export { _Maybe as Maybe }; export const maybe = (guard) => refinement(_Maybe, (m) => isNothing(m) || guard.is(fromJust(m))); //# sourceMappingURL=Maybe.js.map