1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Stub in an ArbitraryDiff type.

This commit is contained in:
Rob Rix 2015-12-11 16:03:04 -05:00
parent fa4e5011ac
commit 21b2d7fdfd

View File

@ -42,6 +42,9 @@ instance (Eq a, Eq annotation, Arbitrary a, Arbitrary annotation) => Arbitrary (
Fixed f -> Fixed <$> (List.subsequences f >>= recursivelyShrink)
Keyed k -> Keyed . Map.fromList <$> (List.subsequences (Map.toList k) >>= recursivelyShrink))
newtype ArbitraryDiff a annotation = ArbitraryDiff (ArbitraryTerm a annotation, ArbitraryTerm a annotation)
deriving (Show, Eq)
instance (Eq a, Eq annotation, Categorizable annotation, Arbitrary a, Arbitrary annotation) => Arbitrary (Diff a annotation) where
arbitrary = interpret comparable <$> (unTerm <$> arbitrary) <*> (unTerm <$> arbitrary)