1{-# LANGUAGE TypeFamilies #-}
2module Reflex.Patch.Class where
4import Control.Monad.Identity
7-- | A 'Patch' type represents a kind of change made to a datastructure.
9 type PatchTarget p :: *
10 -- | Apply the patch @p a@ to the value @a@. If no change is needed, return
12 apply :: p -> PatchTarget p -> Maybe (PatchTarget p)
14applyAlways :: Patch p => p -> PatchTarget p -> PatchTarget p
15applyAlways p t = fromMaybe t $ apply p t
17instance Patch (Identity a) where
18 type PatchTarget (Identity a) = a
19 apply (Identity a) _ = Just a
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