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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章