次の式は、その意図がどのように異なるのでしょうか? 以下の例では、実際にチェックを入力して異なる結果を生成していることに驚いています。
(./) ::
Plated a =>
Traversal s t a a -> Traversal a a u v -> Traversal s t u v
-- Defined in âText.XML.Lensâ
infixr 9 ./
と
(.) :: (b -> c) -> (a -> b) -> a -> c -- Defined in âGHC.Baseâ
infixr 9 .
そして、それらが典型的な pom.xml ファイルでどのように機能するか:
*Main> x ^.. root ./ ell "version" . text
["1.0-SNAPSHOT"]
*Main> x ^.. root ./ ell "version" ./ text
[]
どこ
text ::
Control.Applicative.Applicative f =>
(Data.Text.Internal.Text -> f Data.Text.Internal.Text)
-> Element -> f Element
-- Defined in âText.XML.Lensâ
と
data Element
= Element {elementName :: Name,
elementAttributes :: containers-0.5.5.1:Data.Map.Base.Map
Name Data.Text.Internal.Text,
elementNodes :: [Node]}
-- Defined in âText.XMLâ
instance Plated Element -- Defined in âText.XML.Lensâ