import { Arity3 , Curry3 } from '../types' ; import { curry2 } from './curry2' ; export function curry3 < A , B , C , D > ( fn ) ; export function curry3 ( fn ) ; export function curry3 < A , B , C , D > ( fn ) { function curried ( a , b , c ) { switch ( arguments . length ) { case 1 : return curry2 < B , C , D > ( ( b , c ) => fn ( a , b , c ) ) ; case 2 : return ( c ) => fn ( a , b , c ) ; default : return fn ( a , b , c ) ; } } return curried as Curry3 < A , B , C , D > ; }