{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
--------------------------------------------------------------------------------
-- |
-- Module      :  HGeometry.Point.Instances
-- Copyright   :  (C) Frank Staals
-- License     :  see the LICENSE file
-- Maintainer  :  Frank Staals
--
-- Arbitrary instances for the types in hgeometry-point
--
--------------------------------------------------------------------------------
module HGeometry.Point.Instances where

import HGeometry.Point
import HGeometry.Vector.Instances ()
import Test.QuickCheck
--------------------------------------------------------------------------------

instance Arbitrary v => Arbitrary (PointF v) where
  arbitrary :: Gen (PointF v)
arbitrary = v -> PointF v
forall v. v -> PointF v
Point (v -> PointF v) -> Gen v -> Gen (PointF v)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Gen v
forall a. Arbitrary a => Gen a
arbitrary
  shrink :: PointF v -> [PointF v]
shrink (Point v
v) = v -> PointF v
forall v. v -> PointF v
Point (v -> PointF v) -> [v] -> [PointF v]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> v -> [v]
forall a. Arbitrary a => a -> [a]
shrink v
v