ramda#union TypeScript Examples

The following examples show how to use ramda#union. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: freeVars.ts    From interpreters with MIT License 6 votes vote down vote up
referencedVars = (e: Program | Exp): VarRef[] =>
    isBoolExp(e) ? Array<VarRef>() :
    isNumExp(e) ? Array<VarRef>() :
    isStrExp(e) ? Array<VarRef>() :
    isLitExp(e) ? Array<VarRef>() :
    isPrimOp(e) ? Array<VarRef>() :
    isVarRef(e) ? [e] :
    isIfExp(e) ? reduce(varRefUnion, Array<VarRef>(),
                        map(referencedVars, [e.test, e.then, e.alt])) :
    isAppExp(e) ? union(referencedVars(e.rator),
                        reduce(varRefUnion, Array<VarRef>(), map(referencedVars, e.rands))) :
    isProcExp(e) ? reduce(varRefUnion, Array<VarRef>(), map(referencedVars, e.body)) :
    isDefineExp(e) ? referencedVars(e.val) :
    isProgram(e) ? reduce(varRefUnion, Array<VarRef>(), map(referencedVars, e.exps)) :
    isLetExp(e) ? Array<VarRef>() : // TODO
    e
Example #2
Source File: utils.ts    From notabug with MIT License 6 votes vote down vote up
listingNodesToIds = pipe<
  readonly GunNode[],
  ReadonlyArray<readonly string[]>,
  readonly string[]
>(
  map(listingNodeToIds),
  reduce<readonly string[], readonly string[]>(union, [])
)
Example #3
Source File: freeVars.ts    From interpreters with MIT License 5 votes vote down vote up
varRefUnion = (x: VarRef[], y: VarRef[]) => union(x, y)