/** * unlambda.ts - Unlambda interpreter entry. * * @author CismonX * @license MIT */ import { Parse, ParseResult } from './parser'; import { Eval } from './runtime'; /** * Get the parse result expression, or `never` if parse failed. */ type ParseResultValue = Parse extends [never, ''] ? T[0] : never; /** * Get the output string of an evalalutation result, or `never` * if evaluation failed. */ type EvalResultOutput = T extends [any, [any, infer O, any]] ? O : never; /** * Given the source code of an Unlambda program, and input string. * * Returns the output of program execution, or `never` if something went wrong. */ type Unlambda = EvalResultOutput>, [], [Input, '', '']>>; export default Unlambda;