on develop help sign in
Merge pull request #7 from reflex-frp/jam@fix-docs

Fix docs and add a sentence about what patch is to the readme

commit139e64ebdfc913c9ff60588ca77be8c9e7072602 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateThu 9 Jan 2020, 19:17 (7 years ago) parent9ecfede54ab317
2 files changed+11−1
README.md+10 src/Data/Patch/MapWithMove.hs+1−1
README.md+10
@@ -1,3 +1,13 @@
11## Patch
22
33Infrastructure for writing patches which act on other types.
4+
5+A `Patch` type represents a kind of change made to a datastructure.
6+
7+```haskell
8+class Patch p where
9+ type PatchTarget p :: *
10+ -- | Apply the patch p a to the value a. If no change is needed, return
11+ -- 'Nothing'.
12+ apply :: p -> PatchTarget p -> Maybe (PatchTarget p)
13+```
src/Data/Patch/MapWithMove.hs+1−1
@@ -25,7 +25,7 @@ import qualified Data.Set as Set
2525import Data.These (These(..))
2626import Data.Tuple
2727
28−-- | Patch a DMap with additions, deletions, and moves. Invariant: If key @k1@
28+-- | Patch a Map with additions, deletions, and moves. Invariant: If key @k1@
2929-- is coming from @From_Move k2@, then key @k2@ should be going to @Just k1@,
3030-- and vice versa. There should never be any unpaired From/To keys.
3131newtype PatchMapWithMove k v = PatchMapWithMove (Map k (NodeInfo k v)) deriving (Show, Eq, Ord, Functor, Foldable, Traversable)