Skip to content

Commit 139e64e

Browse files
authored
Merge pull request #7 from reflex-frp/jam@fix-docs
Fix docs and add a sentence about what patch is to the readme
2 parents 9ecfede + 54ab317 commit 139e64e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
## Patch
22

33
Infrastructure 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import qualified Data.Set as Set
2525
import Data.These (These(..))
2626
import 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.
3131
newtype PatchMapWithMove k v = PatchMapWithMove (Map k (NodeInfo k v)) deriving (Show, Eq, Ord, Functor, Foldable, Traversable)

0 commit comments

Comments
 (0)