1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00

Data.These has its own Arbitrary instance these days.

This commit is contained in:
Rob Rix 2016-09-14 16:42:01 -04:00
parent 9f93b1090c
commit 2e28d0d582
3 changed files with 0 additions and 14 deletions

View File

@ -24,7 +24,6 @@ library
, Data.Record
, Data.Mergeable
, Data.Mergeable.Generic
, Data.These.Arbitrary
, Diff
, Diff.Arbitrary
, Diffing

View File

@ -4,7 +4,6 @@ module Data.Bifunctor.Join.Arbitrary where
import Data.Bifunctor.Join
import Data.Functor.Both as Both
import Data.These
import Data.These.Arbitrary ()
import Prologue
import Test.QuickCheck

View File

@ -1,12 +0,0 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.These.Arbitrary where
import Data.These
import Prologue
import Test.QuickCheck
instance (Arbitrary a, Arbitrary b) => Arbitrary (These a b) where
arbitrary = oneof [ This <$> arbitrary
, That <$> arbitrary
, These <$> arbitrary <*> arbitrary ]
shrink = these (fmap This . shrink) (fmap That . shrink) (\ a b -> (This <$> shrink a) ++ (That <$> shrink b) ++ (These <$> shrink a <*> shrink b))