plur-0.2.0.0: Plurality monad: Zero, one, or at least two.

Safe HaskellSafe
LanguageHaskell2010

Data.Plur

Synopsis

Documentation

data Plur a Source #

Plurality monad: Zero, one, or at least two.

Constructors

Zero 
One !a 
Two !a !a 
Instances
Monad Plur Source # 
Instance details

Defined in Data.Plur

Methods

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

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

return :: a -> Plur a #

fail :: String -> Plur a #

Functor Plur Source # 
Instance details

Defined in Data.Plur

Methods

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

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

Applicative Plur Source # 
Instance details

Defined in Data.Plur

Methods

pure :: a -> Plur a #

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

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

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

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

Foldable Plur Source # 
Instance details

Defined in Data.Plur

Methods

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

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

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

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

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

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

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

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

toList :: Plur a -> [a] #

null :: Plur a -> Bool #

length :: Plur a -> Int #

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

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

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

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

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

Traversable Plur Source # 
Instance details

Defined in Data.Plur

Methods

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

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

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

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

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

Defined in Data.Plur

Methods

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

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

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

Defined in Data.Plur

Methods

compare :: Plur a -> Plur a -> Ordering #

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

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

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

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

max :: Plur a -> Plur a -> Plur a #

min :: Plur a -> Plur a -> Plur a #

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

Defined in Data.Plur

Methods

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

show :: Plur a -> String #

showList :: [Plur a] -> ShowS #

Semigroup (Plur a) Source # 
Instance details

Defined in Data.Plur

Methods

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

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

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

Monoid (Plur a) Source # 
Instance details

Defined in Data.Plur

Methods

mempty :: Plur a #

mappend :: Plur a -> Plur a -> Plur a #

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

count :: Plur a -> Int Source #

Erase occurrences, resulting in 0, 1, or 2.