spica
Version:
Supervisor, Coroutine, Channel, select, AtomicPromise, Cancellation, Cache, List, Queue, Stack, and some utils.
16 lines (13 loc) • 370 B
text/typescript
import * as Monad from './maybe.impl';
import { noop } from '../function';
export class Maybe<a> extends Monad.Maybe<a> {
private constructor() {
super(noop as never);
}
}
export type Just<a> = Monad.Just<a>;
export function Just<a>(a: a): Maybe<a> {
return new Monad.Just(a);
}
export type Nothing = Monad.Nothing;
export const Nothing = Monad.Maybe.mzero;