UNPKG

lean4-code-actions

Version:

Refactorings and snippets for Lean 4

6 lines (4 loc) 210 B
import { MapperP } from './index' export const getOneOfTwo = <In, Out>(mapU: MapperP<In, Out | undefined>, map: MapperP<In, Out>) => async (input: In) => { return (await mapU(input)) ?? (await map(input)) }