Functional programming and typing in Typescript / How I could improve the typing of this expression

前端 未结 0 958
醉梦人生
醉梦人生 2021-01-21 09:27
function Box(x: any) {
  return {
    inspect: () => `Box(${x})`,
    map: (f: (arg0: any) => any) => Box(f(x)),
    fold: (f: (arg0: any) => any) => f(x)         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题