mirror of
https://github.com/github/semantic.git
synced 2025-01-04 05:27:08 +03:00
20 lines
481 B
Haskell
20 lines
481 B
Haskell
module Data.Adjoined.Spec where
|
|
|
|
import Data.Adjoined
|
|
import Data.Coalescent
|
|
import Test.QuickCheck
|
|
|
|
|
|
instance Arbitrary a => Arbitrary (Adjoined a) where
|
|
arbitrary = fromList <$> arbitrary
|
|
|
|
-- | A wrapper which never coalesces values.
|
|
newtype Separated a = Separated { unSeparated :: a }
|
|
deriving (Eq, Functor, Show)
|
|
|
|
instance Arbitrary a => Arbitrary (Separated a) where
|
|
arbitrary = Separated <$> arbitrary
|
|
|
|
instance Coalescent (Separated a) where
|
|
coalesce _ _ = Nothing
|