calmm

What's the difference between a lens and a partial lens?

我是研究僧i 提交于 2019-12-03 12:04:32
问题 A "lens" and a "partial lens" seem rather similar in name and in concept. How do they differ? In what circumstances do I need to use one or the other? Tagging Scala and Haskell, but I'd welcome explanations related to any functional language that has a lens library. 回答1: To describe partial lenses—which I will henceforth call, according to the Haskell lens nomenclature, prisms (excepting that they're not! See the comment by Ørjan)—I'd like to begin by taking a different look at lenses