{-# OPTIONS_HADDOCK not-home #-}
module Hedgehog.Internal.Opaque (
    Opaque(..)
  ) where


-- | Opaque values.
--
--   Useful if you want to put something without a 'Show' instance inside
--   something which you'd like to be able to display.
--
--   For example:
--
-- @
--   data State v =
--     State {
--         stateRefs :: [Var (Opaque (IORef Int)) v]
--       } deriving (Eq, Show)
-- @
--
newtype Opaque a =
  Opaque {
      forall a. Opaque a -> a
unOpaque :: a
    } deriving (Opaque a -> Opaque a -> Bool
forall a. Eq a => Opaque a -> Opaque a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Opaque a -> Opaque a -> Bool
$c/= :: forall a. Eq a => Opaque a -> Opaque a -> Bool
== :: Opaque a -> Opaque a -> Bool
$c== :: forall a. Eq a => Opaque a -> Opaque a -> Bool
Eq, Opaque a -> Opaque a -> Bool
Opaque a -> Opaque a -> Ordering
Opaque a -> Opaque a -> Opaque a
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall {a}. Ord a => Eq (Opaque a)
forall a. Ord a => Opaque a -> Opaque a -> Bool
forall a. Ord a => Opaque a -> Opaque a -> Ordering
forall a. Ord a => Opaque a -> Opaque a -> Opaque a
min :: Opaque a -> Opaque a -> Opaque a
$cmin :: forall a. Ord a => Opaque a -> Opaque a -> Opaque a
max :: Opaque a -> Opaque a -> Opaque a
$cmax :: forall a. Ord a => Opaque a -> Opaque a -> Opaque a
>= :: Opaque a -> Opaque a -> Bool
$c>= :: forall a. Ord a => Opaque a -> Opaque a -> Bool
> :: Opaque a -> Opaque a -> Bool
$c> :: forall a. Ord a => Opaque a -> Opaque a -> Bool
<= :: Opaque a -> Opaque a -> Bool
$c<= :: forall a. Ord a => Opaque a -> Opaque a -> Bool
< :: Opaque a -> Opaque a -> Bool
$c< :: forall a. Ord a => Opaque a -> Opaque a -> Bool
compare :: Opaque a -> Opaque a -> Ordering
$ccompare :: forall a. Ord a => Opaque a -> Opaque a -> Ordering
Ord)

instance Show (Opaque a) where
  showsPrec :: Int -> Opaque a -> ShowS
showsPrec Int
_ (Opaque a
_) =
    String -> ShowS
showString String
"Opaque"