3

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
-}
4

1 に答える 1