mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +03:00
Revert "Revert "Define a Crosswalk instance for Patch.""
This reverts commit 20d96850fa7ee2b1ad3c949b128186eaa8f22f6b.
This commit is contained in:
parent
344bff67ce
commit
4ef3604a65
@ -16,6 +16,7 @@ module Patch
|
||||
, patchType
|
||||
) where
|
||||
|
||||
import Data.Align
|
||||
import Data.Functor.Listable
|
||||
import Data.These
|
||||
import Prologue
|
||||
@ -90,3 +91,8 @@ instance Listable1 Patch where
|
||||
|
||||
instance Listable a => Listable (Patch a) where
|
||||
tiers = tiers1
|
||||
|
||||
instance Crosswalk Patch where
|
||||
crosswalk f (Replace a b) = alignWith (these Delete Insert Replace) (f a) (f b)
|
||||
crosswalk f (Insert b) = Insert <$> f b
|
||||
crosswalk f (Delete a) = Delete <$> f a
|
||||
|
Loading…
Reference in New Issue
Block a user