Lens with merge (Semigroup)

5 Sep
2011
5 Sep
'11
3:19 a.m.
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/
5007
Age (days ago)
5007
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tony Morris