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, mapPatchDMapWithMove,
12 patchDMapWithMoveToPatchMapWithMoveWith,
13 traversePatchDMapWithMoveWithKey, unPatchDMapWithMove,
14 unsafePatchDMapWithMove, weakenPatchDMapWithMoveWith)
15import Reflex.Patch.IntMap as X hiding (getDeletions)
16import Reflex.Patch.Map as X
17import Reflex.Patch.MapWithMove as X (PatchMapWithMove, patchMapWithMoveNewElements,
18 patchMapWithMoveNewElementsMap, unPatchMapWithMove,
19 unsafePatchMapWithMove)
21import Data.Semigroup (Semigroup (..), (<>))
23---- Patches based on commutative groups
25-- | A 'Group' is a 'Monoid' where every element has an inverse.
26class (Semigroup q, Monoid q) => Group q where
29 r ~~ s = r <> negateG s
31-- | An 'Additive' 'Semigroup' is one where (<>) is commutative
32class Semigroup q => Additive q where
34-- | The elements of an 'Additive' 'Semigroup' can be considered as patches of their own type.
35newtype AdditivePatch p = AdditivePatch { unAdditivePatch :: p }
37instance Additive p => Patch (AdditivePatch p) where
38 type PatchTarget (AdditivePatch p) = p
39 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