3
我預計今年以評估3,但得到了一個錯誤,而不是:爲什麼不在Idris REPL中使用-notation(bang-notation)?
Idris> :let x = Just 2
Idris> 1 + !x
(input):1:3-4:When checking an application of function Prelude.Interfaces.+:
Type mismatch between
Integer (Type of (_bindApp0))
and
Maybe b (Expected type)
我也試過這個沒有一個頂級的結合,並在事實上如何!
-notation desugars了
Idris> let y = Just 2 in !y + 1
Maybe b is not a numeric type
謝謝你,我莫名其妙地完全閱讀本教程時沒有在-notation的例子'pure' /'return'! – Alexey