Haskell Prelude 中的“const”有什么意义? - What's the point of 'const' in the Haskell Prelude?

问题:

Looking through the Haskell Prelude, I see a function const :查看 Haskell Prelude,我看到了一个函数const

const x _ = x

I can't seem to find anything relevant regarding this function.我似乎找不到与此功能相关的任何内容。

What's the point?重点是什么? Can anyone give an example of where this function might be used?任何人都可以举一个可以在哪里使用此功能的示例吗?


解决方案:

参考: https://stackoom.com/en/question/V3jc
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章