mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-18 19:10:21 -07:00
Add Arbitrary instance for RationalRect
This commit is contained in:
parent
28fff7c1a2
commit
220656aab0
@ -122,6 +122,10 @@ instance Arbitrary RectC where
|
|||||||
instance Arbitrary Rectangle where
|
instance Arbitrary Rectangle where
|
||||||
arbitrary = Rectangle <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
|
arbitrary = Rectangle <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
|
||||||
|
|
||||||
|
instance Arbitrary RationalRect where
|
||||||
|
arbitrary = RationalRect <$> dim <*> dim <*> dim <*> dim
|
||||||
|
where
|
||||||
|
dim = arbitrary `suchThat` liftM2 (&&) (>= 0) (<= 1)
|
||||||
|
|
||||||
newtype SizedPositive = SizedPositive Int
|
newtype SizedPositive = SizedPositive Int
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user