![](/img/trans.png)
[英]Two almost identical functions using STArray: why does one requires FlexibleContexts, and the other does not?
考慮 Haskell 函數 和 第一個需要 FlexibleContexts 在 ghci 8.10.1 上編譯,第二個編譯沒有額外的選項。 為什么? 特別歡迎根據類型變量s的 scope 解釋這種行為的答案。 作為后續,可以將什么(如果有)類型簽名添加到 function f以在沒有 Flexi ...