    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFunctor      #-}
    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE Safe               #-}

    module Data.Tuple.Only where

    import           Control.DeepSeq (NFData (rnf))
    import           Data.Data       (Data)
    import           Data.Typeable   (Typeable)
    import           GHC.Generics    (Generic)

    -- | The 1-tuple type or single-value "collection".
    --
    -- This type is structurally equivalent to the
    -- 'Data.Functor.Identity.Identity' type, but its intent is more
    -- about serving as the anonymous 1-tuple type missing from Haskell for attaching
    -- typeclass instances.
    --
    -- Parameter usage example:
    --
    -- @encodeSomething ('Only' (42::Int))@
    --
    -- Result usage example:
    --
    -- @xs <- decodeSomething
    --forM_ xs $ \\('Only' id) -> {- ... -}@
    --
    newtype Only a = Only { forall a. Only a -> a
    fromOnly :: a }
                   deriving (Only a -> Only a -> Bool
    (Only a -> Only a -> Bool)
    -> (Only a -> Only a -> Bool) -> Eq (Only a)
    forall a. Eq a => Only a -> Only a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => Only a -> Only a -> Bool
    == :: Only a -> Only a -> Bool
    $c/= :: forall a. Eq a => Only a -> Only a -> Bool
    /= :: Only a -> Only a -> Bool
    Eq, Eq (Only a)
    Eq (Only a) =>
    (Only a -> Only a -> Ordering)
    -> (Only a -> Only a -> Bool)
    -> (Only a -> Only a -> Bool)
    -> (Only a -> Only a -> Bool)
    -> (Only a -> Only a -> Bool)
    -> (Only a -> Only a -> Only a)
    -> (Only a -> Only a -> Only a)
    -> Ord (Only a)
    Only a -> Only a -> Bool
    Only a -> Only a -> Ordering
    Only a -> Only a -> Only 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 (Only a)
    forall a. Ord a => Only a -> Only a -> Bool
    forall a. Ord a => Only a -> Only a -> Ordering
    forall a. Ord a => Only a -> Only a -> Only a
    $ccompare :: forall a. Ord a => Only a -> Only a -> Ordering
    compare :: Only a -> Only a -> Ordering
    $c< :: forall a. Ord a => Only a -> Only a -> Bool
    < :: Only a -> Only a -> Bool
    $c<= :: forall a. Ord a => Only a -> Only a -> Bool
    <= :: Only a -> Only a -> Bool
    $c> :: forall a. Ord a => Only a -> Only a -> Bool
    > :: Only a -> Only a -> Bool
    $c>= :: forall a. Ord a => Only a -> Only a -> Bool
    >= :: Only a -> Only a -> Bool
    $cmax :: forall a. Ord a => Only a -> Only a -> Only a
    max :: Only a -> Only a -> Only a
    $cmin :: forall a. Ord a => Only a -> Only a -> Only a
    min :: Only a -> Only a -> Only a
    Ord, ReadPrec [Only a]
    ReadPrec (Only a)
    Int -> ReadS (Only a)
    ReadS [Only a]
    (Int -> ReadS (Only a))
    -> ReadS [Only a]
    -> ReadPrec (Only a)
    -> ReadPrec [Only a]
    -> Read (Only a)
    forall a. Read a => ReadPrec [Only a]
    forall a. Read a => ReadPrec (Only a)
    forall a. Read a => Int -> ReadS (Only a)
    forall a. Read a => ReadS [Only a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (Only a)
    readsPrec :: Int -> ReadS (Only a)
    $creadList :: forall a. Read a => ReadS [Only a]
    readList :: ReadS [Only a]
    $creadPrec :: forall a. Read a => ReadPrec (Only a)
    readPrec :: ReadPrec (Only a)
    $creadListPrec :: forall a. Read a => ReadPrec [Only a]
    readListPrec :: ReadPrec [Only a]
    Read, Int -> Only a -> ShowS
    [Only a] -> ShowS
    Only a -> String
    (Int -> Only a -> ShowS)
    -> (Only a -> String) -> ([Only a] -> ShowS) -> Show (Only a)
    forall a. Show a => Int -> Only a -> ShowS
    forall a. Show a => [Only a] -> ShowS
    forall a. Show a => Only a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> Only a -> ShowS
    showsPrec :: Int -> Only a -> ShowS
    $cshow :: forall a. Show a => Only a -> String
    show :: Only a -> String
    $cshowList :: forall a. Show a => [Only a] -> ShowS
    showList :: [Only a] -> ShowS
    Show, (forall x. Only a -> Rep (Only a) x)
    -> (forall x. Rep (Only a) x -> Only a) -> Generic (Only a)
    forall x. Rep (Only a) x -> Only a
    forall x. Only a -> Rep (Only a) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall a x. Rep (Only a) x -> Only a
    forall a x. Only a -> Rep (Only a) x
    $cfrom :: forall a x. Only a -> Rep (Only a) x
    from :: forall x. Only a -> Rep (Only a) x
    $cto :: forall a x. Rep (Only a) x -> Only a
    to :: forall x. Rep (Only a) x -> Only a
    Generic, (forall a b. (a -> b) -> Only a -> Only b)
    -> (forall a b. a -> Only b -> Only a) -> Functor Only
    forall a b. a -> Only b -> Only a
    forall a b. (a -> b) -> Only a -> Only b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> Only a -> Only b
    fmap :: forall a b. (a -> b) -> Only a -> Only b
    $c<$ :: forall a b. a -> Only b -> Only a
    <$ :: forall a b. a -> Only b -> Only a
    Functor, Typeable (Only a)
    Typeable (Only a) =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Only a -> c (Only a))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (Only a))
    -> (Only a -> Constr)
    -> (Only a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (Only a)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a)))
    -> ((forall b. Data b => b -> b) -> Only a -> Only a)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Only a -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Only a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Only a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Only a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Only a -> m (Only a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Only a -> m (Only a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Only a -> m (Only a))
    -> Data (Only a)
    Only a -> Constr
    Only a -> DataType
    (forall b. Data b => b -> b) -> Only a -> Only a
    forall a. Data a => Typeable (Only a)
    forall a. Data a => Only a -> Constr
    forall a. Data a => Only a -> DataType
    forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Only a -> Only a
    forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Only a -> u
    forall a u. Data a => (forall d. Data d => d -> u) -> Only a -> [u]
    forall a r r'.
    Data a =>
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    forall a r r'.
    Data a =>
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Only a)
    forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Only a -> c (Only a)
    forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Only a))
    forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a))
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Only a -> u
    forall u. (forall d. Data d => d -> u) -> Only a -> [u]
    forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Only a)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Only a -> c (Only a)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Only a))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a))
    $cgfoldl :: forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Only a -> c (Only a)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Only a -> c (Only a)
    $cgunfold :: forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Only a)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Only a)
    $ctoConstr :: forall a. Data a => Only a -> Constr
    toConstr :: Only a -> Constr
    $cdataTypeOf :: forall a. Data a => Only a -> DataType
    dataTypeOf :: Only a -> DataType
    $cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (Only a))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Only a))
    $cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a))
    $cgmapT :: forall a.
    Data a =>
    (forall b. Data b => b -> b) -> Only a -> Only a
    gmapT :: (forall b. Data b => b -> b) -> Only a -> Only a
    $cgmapQl :: forall a r r'.
    Data a =>
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    gmapQl :: forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    $cgmapQr :: forall a r r'.
    Data a =>
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    gmapQr :: forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r
    $cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Only a -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Only a -> [u]
    $cgmapQi :: forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> Only a -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Only a -> u
    $cgmapM :: forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    $cgmapMp :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    $cgmapMo :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Only a -> m (Only a)
    Data, Typeable)

    instance NFData a => NFData (Only a) where
        rnf :: Only a -> ()
    rnf = a -> ()
    forall a. NFData a => a -> ()
    rnf (a -> ()) -> (Only a -> a) -> Only a -> ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Only a -> a
    forall a. Only a -> a
    fromOnly