packages feed

pipes-key-value-csv-0.0.0.0: test/Test/Instances.hs

{-# LANGUAGE 
    DataKinds
  , FlexibleContexts
  , FlexibleInstances
  , StandaloneDeriving
  , TypeOperators
  #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}

module Test.Instances where

import Data.Vinyl
import Data.Vinyl.Functor
import Test.QuickCheck

instance Arbitrary (Rec f '[]) where
  arbitrary = pure RNil
  shrink = shrinkNothing

instance (Arbitrary (Rec f rs), Arbitrary (f r)) => Arbitrary (Rec f (r ': rs)) where
  arbitrary = (:&) <$> arbitrary <*> arbitrary
  shrink = shrinkNothing

deriving instance Eq a => Eq (Identity a)

instance Arbitrary a => Arbitrary (Identity a) where
  arbitrary = Identity <$> arbitrary
  shrink (Identity a) = Identity <$> shrink a