mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Generalize the Arbitrary instance over Records of multiple fields.
This commit is contained in:
parent
2d4dadb167
commit
636fbd102b
@ -61,7 +61,7 @@ instance Ord (Record '[]) where
|
||||
_ `compare` _ = EQ
|
||||
|
||||
|
||||
instance Arbitrary fields => Arbitrary (Record '[fields]) where
|
||||
arbitrary = RCons <$> arbitrary <*> pure RNil
|
||||
instance (Arbitrary field, Arbitrary (Record fields)) => Arbitrary (Record (field ': fields)) where
|
||||
arbitrary = RCons <$> arbitrary <*> arbitrary
|
||||
|
||||
shrink (RCons h t) = RCons <$> shrink h <*> pure t
|
||||
shrink (RCons h t) = RCons <$> shrink h <*> shrink t
|
||||
|
Loading…
Reference in New Issue
Block a user