OneTuple-0.3.1: Singleton Tuple
Safe HaskellSafe
LanguageHaskell98

Data.Tuple.Solo

Description

Solo fills the tuple gap with a singleton tuple.

Solo does not support the usual parenthesized tuple syntax.

Solo

  • has the expected laziness properties
  • can be pattern-matched
  • ships with instances for several standard type classes, including all those supported by H98-standard tuples
  • requires no language extensions, except for hierarchical modules

Note: on GHC-9.0 getSolo is not a record selector.

Synopsis

Documentation

data Solo a Source #

Solo is the singleton tuple data type.

Constructors

Solo a 

Instances

Instances details
Monad Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

(>>=) :: Solo a -> (a -> Solo b) -> Solo b #

(>>) :: Solo a -> Solo b -> Solo b #

return :: a -> Solo a #

Functor Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

fmap :: (a -> b) -> Solo a -> Solo b #

(<$) :: a -> Solo b -> Solo a #

MonadFix Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

mfix :: (a -> Solo a) -> Solo a #

Applicative Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

pure :: a -> Solo a #

(<*>) :: Solo (a -> b) -> Solo a -> Solo b #

liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c #

(*>) :: Solo a -> Solo b -> Solo b #

(<*) :: Solo a -> Solo b -> Solo a #

Foldable Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

fold :: Monoid m => Solo m -> m #

foldMap :: Monoid m => (a -> m) -> Solo a -> m #

foldMap' :: Monoid m => (a -> m) -> Solo a -> m #

foldr :: (a -> b -> b) -> b -> Solo a -> b #

foldr' :: (a -> b -> b) -> b -> Solo a -> b #

foldl :: (b -> a -> b) -> b -> Solo a -> b #

foldl' :: (b -> a -> b) -> b -> Solo a -> b #

foldr1 :: (a -> a -> a) -> Solo a -> a #

foldl1 :: (a -> a -> a) -> Solo a -> a #

toList :: Solo a -> [a] #

null :: Solo a -> Bool #

length :: Solo a -> Int #

elem :: Eq a => a -> Solo a -> Bool #

maximum :: Ord a => Solo a -> a #

minimum :: Ord a => Solo a -> a #

sum :: Num a => Solo a -> a #

product :: Num a => Solo a -> a #

Traversable Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

traverse :: Applicative f => (a -> f b) -> Solo a -> f (Solo b) #

sequenceA :: Applicative f => Solo (f a) -> f (Solo a) #

mapM :: Monad m => (a -> m b) -> Solo a -> m (Solo b) #

sequence :: Monad m => Solo (m a) -> m (Solo a) #

Eq1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

liftEq :: (a -> b -> Bool) -> Solo a -> Solo b -> Bool #

Ord1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

liftCompare :: (a -> b -> Ordering) -> Solo a -> Solo b -> Ordering #

Read1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Solo a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Solo a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Solo a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Solo a] #

Show1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Solo a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Solo a] -> ShowS #

MonadZip Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

mzip :: Solo a -> Solo b -> Solo (a, b) #

mzipWith :: (a -> b -> c) -> Solo a -> Solo b -> Solo c #

munzip :: Solo (a, b) -> (Solo a, Solo b) #

Hashable1 Solo Source #

Since: 0.3.1

Instance details

Defined in Data.Tuple.Solo

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Solo a -> Int #

Bounded a => Bounded (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

minBound :: Solo a #

maxBound :: Solo a #

Enum a => Enum (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

succ :: Solo a -> Solo a #

pred :: Solo a -> Solo a #

toEnum :: Int -> Solo a #

fromEnum :: Solo a -> Int #

enumFrom :: Solo a -> [Solo a] #

enumFromThen :: Solo a -> Solo a -> [Solo a] #

enumFromTo :: Solo a -> Solo a -> [Solo a] #

enumFromThenTo :: Solo a -> Solo a -> Solo a -> [Solo a] #

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

Defined in Data.Tuple.Solo

Methods

(==) :: Solo a -> Solo a -> Bool #

(/=) :: Solo a -> Solo a -> Bool #

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

Defined in Data.Tuple.Solo

Methods

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

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

toConstr :: Solo a -> Constr #

dataTypeOf :: Solo a -> DataType #

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

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

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

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

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

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

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

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

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

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

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

Defined in Data.Tuple.Solo

Methods

compare :: Solo a -> Solo a -> Ordering #

(<) :: Solo a -> Solo a -> Bool #

(<=) :: Solo a -> Solo a -> Bool #

(>) :: Solo a -> Solo a -> Bool #

(>=) :: Solo a -> Solo a -> Bool #

max :: Solo a -> Solo a -> Solo a #

min :: Solo a -> Solo a -> Solo a #

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

Defined in Data.Tuple.Solo

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

Defined in Data.Tuple.Solo

Methods

showsPrec :: Int -> Solo a -> ShowS #

show :: Solo a -> String #

showList :: [Solo a] -> ShowS #

Ix a => Ix (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

range :: (Solo a, Solo a) -> [Solo a] #

index :: (Solo a, Solo a) -> Solo a -> Int #

unsafeIndex :: (Solo a, Solo a) -> Solo a -> Int #

inRange :: (Solo a, Solo a) -> Solo a -> Bool #

rangeSize :: (Solo a, Solo a) -> Int #

unsafeRangeSize :: (Solo a, Solo a) -> Int #

Generic (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Associated Types

type Rep (Solo a) :: Type -> Type #

Methods

from :: Solo a -> Rep (Solo a) x #

to :: Rep (Solo a) x -> Solo a #

Semigroup a => Semigroup (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

(<>) :: Solo a -> Solo a -> Solo a #

sconcat :: NonEmpty (Solo a) -> Solo a #

stimes :: Integral b => b -> Solo a -> Solo a #

Monoid a => Monoid (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

Methods

mempty :: Solo a #

mappend :: Solo a -> Solo a -> Solo a #

mconcat :: [Solo a] -> Solo a #

Hashable a => Hashable (Solo a) Source #

Since: 0.3.1

Instance details

Defined in Data.Tuple.Solo

Methods

hashWithSalt :: Int -> Solo a -> Int #

hash :: Solo a -> Int #

Generic1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

Associated Types

type Rep1 Solo :: k -> Type #

Methods

from1 :: forall (a :: k). Solo a -> Rep1 Solo a #

to1 :: forall (a :: k). Rep1 Solo a -> Solo a #

type Rep (Solo a) Source # 
Instance details

Defined in Data.Tuple.Solo

type Rep (Solo a) = D1 ('MetaData "Solo" "Data.Tuple.Solo" "OneTuple-0.3.1-BqbY3oyhx6yHTsM8tFX55j" 'False) (C1 ('MetaCons "Solo" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSolo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 Solo Source # 
Instance details

Defined in Data.Tuple.Solo

type Rep1 Solo = D1 ('MetaData "Solo" "Data.Tuple.Solo" "OneTuple-0.3.1-BqbY3oyhx6yHTsM8tFX55j" 'False) (C1 ('MetaCons "Solo" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSolo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

getSolo :: Solo a -> a Source #