const DoF = DSL.getDoF(Either.Monad) /** * @tsplus static Either.Ops Do */ export const Do = DoF.Do /** * @tsplus static Either.Aspects bind * @tsplus pipeable Either bind */ export function bind( name: N extends keyof Scope ? { error: `binding name '${N}' already in use` } : N, f: (_: Scope) => Either ) { return ( self: Either ): Either => DoF.bind(name, f)(self) } /** * @tsplus static Either.Aspects bindValue * @tsplus pipeable Either bindValue */ export function bindValue( name: N extends keyof Scope ? { error: `binding name '${N}' already in use` } : N, f: (_: Scope) => B ) { return ( self: Either ): Either => DoF.bindValue(name, f)(self) }