1-- | This module defines the 'Patch' class, which is used by Reflex to manage
2-- changes to 'Reflex.Class.Incremental' values.
3{-# LANGUAGE TypeFamilies #-}
9import Reflex.Patch.Class as X
10import Reflex.Patch.DMap as X hiding (getDeletions)
11import Reflex.Patch.DMapWithMove as X (PatchDMapWithMove, const2PatchDMapWithMoveWith, patchDMapWithMoveToPatchMapWithMoveWith, mapPatchDMapWithMove, weakenPatchDMapWithMoveWith, traversePatchDMapWithMoveWithKey, unsafePatchDMapWithMove, unPatchDMapWithMove)
12import Reflex.Patch.Map as X
13import Reflex.Patch.MapWithMove as X (PatchMapWithMove, patchMapWithMoveNewElementsMap, patchMapWithMoveNewElements, unsafePatchMapWithMove, unPatchMapWithMove)
14import Reflex.Patch.IntMap as X hiding (getDeletions)
16import Data.Semigroup (Semigroup (..), (<>))
18---- Patches based on commutative groups
20-- | A 'Group' is a 'Monoid' where every element has an inverse.
21class (Semigroup q, Monoid q) => Group q where
24 r ~~ s = r <> negateG s
26-- | An 'Additive' 'Semigroup' is one where (<>) is commutative
27class Semigroup q => Additive q where
29-- | The elements of an 'Additive' 'Semigroup' can be considered as patches of their own type.
30newtype AdditivePatch p = AdditivePatch { unAdditivePatch :: p }
32instance Additive p => Patch (AdditivePatch p) where
33 type PatchTarget (AdditivePatch p) = p
34 apply (AdditivePatch p) q = Just $ p <> q
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list