Keeping partially applied function generic

前端 未结 3 1060
萌比男神i
萌比男神i 2020-12-19 07:06

Is it possible to partially apply a function such as bprintf and prevent it from being restricted based on its initial use?

I\'d like to do the followin

3条回答
  •  轮回少年
    2020-12-19 07:22

    you can add explicit format argument

    let builder = new System.Text.StringBuilder()
    let append format = Printf.bprintf builder format
    append "%i" 10
    append "%s" "1"
    

提交回复
热议问题