我做了一个最小的例子来测试 fclabels。使用镜头从 Either 值中检索“正确”值。为什么会失败?我错过了什么吗?
module Label where
import Data.Label
import Data.Label.Base
test = get right (Right "test")
{- Will fail with this message:
Label.hs:5:12:
No instance for (Control.Arrow.ArrowZero Data.Label.Point.Total)
arising from a use of `right'
Possible fix:
add an instance declaration for
(Control.Arrow.ArrowZero Data.Label.Point.Total)
In the first argument of `get', namely `right'
In the expression: get right (Right "test")
In an equation for `test': test = get right (Right "test")
Failed, modules loaded: none.
-- Tested with fclabels-2.0.2
-}