/** * index.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 = T[1] extends '' ? T[0] : never; /** * Get the output string of an evalalutation result, or `never` if evaluation failed. */ type EvalResultOutput = T extends [infer F, [infer I, infer O, infer C]] ? 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;