我正在尝试使用 xml-conduit 和 xml-lens 来解析和遍历 XML 文档。不必多次遍历文档的相同部分,我想将遍历存储到前一点,然后进一步向下钻取。
前任。
let pos = doc ^. root . el "foo"
bar = pos . text
baz = pos ./ el "quux" . text
当我尝试这样做时,我收到以下错误:
No instance for (Data.Monoid.Monoid Element)
arising from a use of `el'
Possible fix:
add an instance declaration for (Data.Monoid.Monoid Element)
In the second argument of `(.)', namely `el "foo"'
In the second argument of `(^.)', namely `root . el "foo"'
In the expression: doc ^. root . el "foo"
我能做些什么来存储这个中间位置?