Safe Haskell | None |
---|
Documentation
A data type which is equivalent to Either, but which is persisted in an open manner which allows us to chain new variants on the left. As more variants are added (going from NoRev to V1 :> NoRev and then to V2 :> V1 :> NoRev), the persisted representation gets expanded without breaking the representation of previous variants. We do not use Either because of the risk of persisting it in the standard manner and therefore losing upgradability.
Typeable2 :> | |
PersistentRev (:> b r) => Persistent (:> b r) | |
(Rev (:> b r), Persistent b, PersistentRev r) => PersistentRev (:> b r) | |
Rev b => Rev (:> a b) |
An uninhabited type used as the last (rightmost) type in chains of '(:>)'
revPersister :: PersistentRev a => Persister aSource
The persister for '(:>)' first writes out the numeric index, from the right, in the chain of revisions. This way the chain of alternative revisions can lengthen without changing the indices of past revisions.
latestLens :: (b -> a) -> Lens (a :> b) aSource
This is not a legal lens since it violates the law which says that setting back what you got must have no effect. Here it is almost true since the only effect it has is to upgrade to the current representation, an idempotent change for a semantically equivalent value.