base-compat-batteries-0.12.1: base-compat with extra batteries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Tuple.Compat

Synopsis

Documentation

data Solo a #

Solo is the singleton tuple data type.

Constructors

Solo 

Fields

Instances

Instances details
Monad Solo 
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 
Instance details

Defined in Data.Tuple.Solo

Methods

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

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

MonadFix Solo 
Instance details

Defined in Data.Tuple.Solo

Methods

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

Applicative Solo 
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 
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 
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 
Instance details

Defined in Data.Tuple.Solo

Methods

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

Ord1 Solo 
Instance details

Defined in Data.Tuple.Solo

Methods

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

Read1 Solo 
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 
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 
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) #

Bounded a => Bounded (Solo a) 
Instance details

Defined in Data.Tuple.Solo

Methods

minBound :: Solo a #

maxBound :: Solo a #

Enum a => Enum (Solo a) 
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) 
Instance details

Defined in Data.Tuple.Solo

Methods

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

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

Data a => Data (Solo a) 
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) 
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) 
Instance details

Defined in Data.Tuple.Solo

Show a => Show (Solo a) 
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) 
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) 
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) 
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) 
Instance details

Defined in Data.Tuple.Solo

Methods

mempty :: Solo a #

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

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

Generic1 Solo 
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) 
Instance details

Defined in Data.Tuple.Solo

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

Defined in Data.Tuple.Solo

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

fst :: (a, b) -> a #

Extract the first component of a pair.

snd :: (a, b) -> b #

Extract the second component of a pair.

curry :: ((a, b) -> c) -> a -> b -> c #

curry converts an uncurried function to a curried function.

Examples

Expand
>>> curry fst 1 2
1

uncurry :: (a -> b -> c) -> (a, b) -> c #

uncurry converts a curried function to a function on pairs.

Examples

Expand
>>> uncurry (+) (1,2)
3
>>> uncurry ($) (show, 1)
"1"
>>> map (uncurry max) [(1,2), (3,4), (6,8)]
[2,4,8]

swap :: (a, b) -> (b, a) #

Swap the components of a pair.