mirror of
https://github.com/github/semantic.git
synced 2024-11-28 18:23:44 +03:00
Define the arbitrary instances for Row and Line in terms of an Arbitrary type a.
This commit is contained in:
parent
3424df075a
commit
c9f13f2f41
@ -12,7 +12,7 @@ import Control.Monad.Free hiding (unfold)
|
|||||||
import Patch
|
import Patch
|
||||||
import Syntax
|
import Syntax
|
||||||
|
|
||||||
instance Arbitrary (Row a) where
|
instance Arbitrary a => Arbitrary (Row a) where
|
||||||
arbitrary = oneof [
|
arbitrary = oneof [
|
||||||
Row <$> arbitrary <*> arbitrary ]
|
Row <$> arbitrary <*> arbitrary ]
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ instance Arbitrary HTML where
|
|||||||
Span <$> arbitrary <*> arbitrary,
|
Span <$> arbitrary <*> arbitrary,
|
||||||
const Break <$> (arbitrary :: Gen ()) ]
|
const Break <$> (arbitrary :: Gen ()) ]
|
||||||
|
|
||||||
instance Arbitrary (Line a) where
|
instance Arbitrary a => Arbitrary (Line a) where
|
||||||
arbitrary = oneof [
|
arbitrary = oneof [
|
||||||
Line <$> arbitrary <*> arbitrary,
|
Line <$> arbitrary <*> arbitrary,
|
||||||
const EmptyLine <$> (arbitrary :: Gen ()) ]
|
const EmptyLine <$> (arbitrary :: Gen ()) ]
|
||||||
|
Loading…
Reference in New Issue
Block a user