A regular Lens can be represented as follows:

data CoState a = CoState (a -> b) a

newtype Lens a b = Lens (a -> CoState b a)

I once read about a lens representation that permits a general "merge"
operation. I forget where I read it -- I think it was #haskell IRC.
However, as I recall, perhaps incorrectly, the merge operation involves
a Semigroup[1] and helps to overcome the fact that Lens is not an Arrow
and so does not have a (&&&) operation.

I am interested to know what this Lens operation is and the associated
merge operation.

[1]
-- Approximate
data SemigroupT f a = SemigroupT (a -> a -> f a)


-- 
Tony Morris
http://tmorris.net/



_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to