primus-0.3.0.0: nonempty and positive functions
Copyright(c) Grant Weyburne 2016
LicenseBSD-3
Safe HaskellNone
LanguageHaskell2010

Primus.One

Description

handles a tuple of size one. this is a special type that distinguishes a singleton value from a ntuple will be replaced by Solo when ghc 9.2 is standard and generics-sop is updated to support Solo

Synopsis

Documentation

newtype One a Source #

One holds a single value. To use wprint we need a SOP Generics instance

Constructors

One a 

Instances

Instances details
Monad One Source # 
Instance details

Defined in Primus.One

Methods

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

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

return :: a -> One a #

Functor One Source # 
Instance details

Defined in Primus.One

Methods

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

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

Applicative One Source # 
Instance details

Defined in Primus.One

Methods

pure :: a -> One a #

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

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

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

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

Foldable One Source # 
Instance details

Defined in Primus.One

Methods

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

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

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

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

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

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

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

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

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

toList :: One a -> [a] #

null :: One a -> Bool #

length :: One a -> Int #

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

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

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

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

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

Traversable One Source # 
Instance details

Defined in Primus.One

Methods

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

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

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

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

NFData1 One Source # 
Instance details

Defined in Primus.One

Methods

liftRnf :: (a -> ()) -> One a -> () #

Traversable1 One Source # 
Instance details

Defined in Primus.One

Methods

traverse1 :: Apply f => (a -> f b) -> One a -> f (One b) #

sequence1 :: Apply f => One (f b) -> f (One b) #

Apply One Source # 
Instance details

Defined in Primus.One

Methods

(<.>) :: One (a -> b) -> One a -> One b #

(.>) :: One a -> One b -> One b #

(<.) :: One a -> One b -> One a #

liftF2 :: (a -> b -> c) -> One a -> One b -> One c #

Foldable1 One Source # 
Instance details

Defined in Primus.One

Methods

fold1 :: Semigroup m => One m -> m #

foldMap1 :: Semigroup m => (a -> m) -> One a -> m #

toNonEmpty :: One a -> NonEmpty a #

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

Defined in Primus.One

Methods

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

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

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

Defined in Primus.One

Methods

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

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

toConstr :: One a -> Constr #

dataTypeOf :: One a -> DataType #

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

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

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

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

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

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

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

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

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

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

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

Defined in Primus.One

Methods

compare :: One a -> One a -> Ordering #

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

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

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

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

max :: One a -> One a -> One a #

min :: One a -> One a -> One a #

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

Defined in Primus.One

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

Defined in Primus.One

Methods

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

show :: One a -> String #

showList :: [One a] -> ShowS #

Generic (One a) Source # 
Instance details

Defined in Primus.One

Associated Types

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

Methods

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

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

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

Defined in Primus.One

Methods

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

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

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

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

Defined in Primus.One

Methods

mempty :: One a #

mappend :: One a -> One a -> One a #

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

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

Defined in Primus.One

Methods

rnf :: One a -> () #

ITupleC (One a1) Source # 
Instance details

Defined in Primus.TypeLevel

Methods

toITupleC :: One a1 -> ToITupleT (One a1) Source #

fromITupleC :: ToITupleT (One a1) -> One a1 Source #

Generic1 One Source # 
Instance details

Defined in Primus.One

Associated Types

type Rep1 One :: k -> Type #

Methods

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

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

type Rep (One a) Source # 
Instance details

Defined in Primus.One

type Rep (One a) = D1 ('MetaData "One" "Primus.One" "primus-0.3.0.0-HWjmNHShjq52t4uZ5YxnWQ" 'True) (C1 ('MetaCons "One" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep1 One Source # 
Instance details

Defined in Primus.One

type Rep1 One = D1 ('MetaData "One" "Primus.One" "primus-0.3.0.0-HWjmNHShjq52t4uZ5YxnWQ" 'True) (C1 ('MetaCons "One" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

unOne :: One a -> a Source #

unwrap One