module /** */ import { ParjserBase } from "../parser" ; import { Parjser , ParjsCombinator , ImplicitParjser } from "../../index" ; import { ScalarConverter } from "../scalar-converter" ; param f export function defineCombinator ( f ) { return ( x ) => { let resolved = ScalarConverter . convert ( x ) ; return f ( resolved as ParjserBase ) ; } ; } param f1 export function composeCombinator < A , B > ( f1 ) ; param f1 param f2 export function composeCombinator < A , B , C > ( f1 , f2 ) ; param f1 param f2 param f3 export function composeCombinator < A , B , C , D > ( f1 , f2 , f3 ) ; export function composeCombinator ( ... fs ) { return x => { let last = x ; for ( let f of fs ) { last = f ( last ) ; } return last ; } ; } param source param cmb1 export function pipe < T , T1 > ( source , cmb1 ) ; param source param cmb1 param cmb2 export function pipe < T , T1 , T2 > ( source , cmb1 , cmb2 ) ; param source param cmb1 param cmb2 param cmb3 export function pipe < T , T1 , T2 , T3 > ( source , cmb1 , cmb2 , cmb3 ) ; param source param cmb1 param cmb2 param cmb3 param cmb4 export function pipe < T , T1 , T2 , T3 , T4 > ( source , cmb1 , cmb2 , cmb3 , cmb4 ) ; param source param cmb1 param cmb2 param cmb3 param cmb4 param cmb5 export function pipe < T , T1 , T2 , T3 , T4 , T5 > ( source , cmb1 , cmb2 , cmb3 , cmb4 , cmb5 ) ; param source param cmb1 param cmb2 param cmb3 param cmb4 param cmb5 param cmb6 export function pipe < T , T1 , T2 , T3 , T4 , T5 , T6 > ( source , cmb1 , cmb2 , cmb3 , cmb4 , cmb5 , cmb6 ) ; export function pipe ( source , ... funcs ) { let last = ScalarConverter . convert ( source ) ; for ( let func of funcs ) { last = func ( last ) ; } return last ; }