1
1
mirror of https://github.com/github/semantic.git synced 2024-12-28 09:21:35 +03:00

📝 DiffFor.

This commit is contained in:
Rob Rix 2019-10-02 15:21:13 -04:00
parent e4346562d6
commit 0c3170edc4
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -31,6 +31,9 @@ stripDiff = bimap snd snd
-- | The class of term types for which we can compute a diff. -- | The class of term types for which we can compute a diff.
class (Bifoldable (DiffFor term)) => DiffTerms term where class (Bifoldable (DiffFor term)) => DiffTerms term where
-- | The type of diffs for the given term type.
--
-- Note that the dependency means that the diff type is in 1:1 correspondence with the term type. This allows subclasses of 'DiffTerms' to receive e.g. @'DiffFor' term a b@ without incurring ambiguity, since every diff type is unique to its term type.
type DiffFor term = (diff :: * -> * -> *) | diff -> term type DiffFor term = (diff :: * -> * -> *) | diff -> term
-- | Diff a 'These' of terms. -- | Diff a 'These' of terms.