Only-0.1: The 1-tuple type or single-value "collection"
Safe Haskell Safe
Language Haskell2010

Data.Tuple.Only

Synopsis

Documentation

newtype Only a Source #

The 1-tuple type or single-value "collection".

This type is structurally equivalent to the 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) -> {- ... -}

Constructors

Only

Fields

Instances

Instances details
Functor Only Source #
Instance details

Defined in Data.Tuple.Only

Eq a => Eq ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Data a => Data ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Only a -> c ( Only a) Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( Only a) Source #

toConstr :: Only a -> Constr Source #

dataTypeOf :: Only a -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( Only a)) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( Only a)) Source #

gmapT :: ( forall b. Data b => b -> b) -> Only a -> Only a Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Only a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Only a -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Only a -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Only a -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Only a -> m ( Only a) Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Only a -> m ( Only a) Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Only a -> m ( Only a) Source #

Ord a => Ord ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Read a => Read ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Show a => Show ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Generic ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep ( Only a) :: Type -> Type Source #

NFData a => NFData ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

Methods

rnf :: Only a -> () Source #

type Rep ( Only a) Source #
Instance details

Defined in Data.Tuple.Only

type Rep ( Only a) = D1 (' MetaData "Only" "Data.Tuple.Only" "Only-0.1-5HMnGEdyovGeWGWSTFEMo" ' True ) ( C1 (' MetaCons "Only" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "fromOnly") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 a)))