我一直在考虑是否可以添加一些方法Traversable来使其在昂贵的仿函数存在的情况下更便宜地组合。灵感是Control.Lens.Traversal.confusing,它使用特殊Applicative来做类似的事情。
confusing :: Applicative f => LensLike (Curried (Yoneda f) (Yoneda f)) s t a b -> LensLike f s t a b
不幸的是,confusing它真的名副其实——我不明白它实际上在做什么。特别是,我对Curried.
此外,confusing它具有 CPS 的味道,这表明它可能对我的目的来说太严格了。Yoneda可以换掉Coyoneda以增强懒惰,但我不知道如何处理Curried.