non-empty-0.3.3: List-like structures with static restrictions on the number of elements
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Optional

Documentation

data T f a Source #

Constructors

Nil 
Cons a (f a) 

Instances

Instances details
Functor f => Functor (T f) Source # 
Instance details

Defined in Data.Optional

Methods

fmap :: (a -> b) -> T f a -> T f b #

(<$) :: a -> T f b -> T f a #

Foldable f => Foldable (T f) Source # 
Instance details

Defined in Data.Optional

Methods

fold :: Monoid m => T f m -> m #

foldMap :: Monoid m => (a -> m) -> T f a -> m #

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

foldr :: (a -> b -> b) -> b -> T f a -> b #

foldr' :: (a -> b -> b) -> b -> T f a -> b #

foldl :: (b -> a -> b) -> b -> T f a -> b #

foldl' :: (b -> a -> b) -> b -> T f a -> b #

foldr1 :: (a -> a -> a) -> T f a -> a #

foldl1 :: (a -> a -> a) -> T f a -> a #

toList :: T f a -> [a] #

null :: T f a -> Bool #

length :: T f a -> Int #

elem :: Eq a => a -> T f a -> Bool #

maximum :: Ord a => T f a -> a #

minimum :: Ord a => T f a -> a #

sum :: Num a => T f a -> a #

product :: Num a => T f a -> a #

Traversable f => Traversable (T f) Source # 
Instance details

Defined in Data.Optional

Methods

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

sequenceA :: Applicative f0 => T f (f0 a) -> f0 (T f a) #

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

sequence :: Monad m => T f (m a) -> m (T f a) #

NFData f => NFData (T f) Source # 
Instance details

Defined in Data.Optional

Methods

rnf :: NFData a => T f a -> () Source #

Gen f => Gen (T f) Source # 
Instance details

Defined in Data.Optional

Methods

genOf :: Gen a -> Gen (T f a) Source #

Arbitrary f => Arbitrary (T f) Source # 
Instance details

Defined in Data.Optional

Methods

arbitrary :: Arbitrary a => Gen (T f a) Source #

shrink :: Arbitrary a => T f a -> [T f a] Source #

Show f => Show (T f) Source # 
Instance details

Defined in Data.Optional

Methods

showsPrec :: Show a => Int -> T f a -> ShowS Source #

(Traversable f, Reverse f) => Reverse (T f) Source # 
Instance details

Defined in Data.Optional

Methods

reverse :: T f a -> T f a Source #

(InsertBy f, SortBy f) => SortBy (T f) Source # 
Instance details

Defined in Data.Optional

Methods

sortBy :: (a -> a -> Ordering) -> T f a -> T f a Source #

(Insert f, Sort f) => Sort (T f) Source # 
Instance details

Defined in Data.Optional

Methods

sort :: Ord a => T f a -> T f a Source #

Iterate f => Iterate (T f) Source # 
Instance details

Defined in Data.Optional

Methods

iterate :: (a -> a) -> a -> T f a Source #

Repeat f => Repeat (T f) Source # 
Instance details

Defined in Data.Optional

Methods

repeat :: a -> T f a Source #

Zip f => Zip (T f) Source # 
Instance details

Defined in Data.Optional

Methods

zipWith :: (a -> b -> c) -> T f a -> T f b -> T f c Source #

(Cons f, Empty f) => Cons (T f) Source # 
Instance details

Defined in Data.Optional

Methods

cons :: a -> T f a -> T f a Source #

Empty (T f) Source # 
Instance details

Defined in Data.Optional

Methods

empty :: T f a Source #

InsertBy f => InsertBy (T f) Source # 
Instance details

Defined in Data.Optional

Methods

insertBy :: (a -> a -> Ordering) -> a -> T f a -> T0 (T f) a Source #

Insert f => Insert (T f) Source # 
Instance details

Defined in Data.Optional

Methods

insert :: Ord a => a -> T f a -> T0 (T f) a Source #

(Eq a, Eq (f a)) => Eq (T f a) Source # 
Instance details

Defined in Data.Optional

Methods

(==) :: T f a -> T f a -> Bool #

(/=) :: T f a -> T f a -> Bool #

(Ord a, Ord (f a)) => Ord (T f a) Source # 
Instance details

Defined in Data.Optional

Methods

compare :: T f a -> T f a -> Ordering #

(<) :: T f a -> T f a -> Bool #

(<=) :: T f a -> T f a -> Bool #

(>) :: T f a -> T f a -> Bool #

(>=) :: T f a -> T f a -> Bool #

max :: T f a -> T f a -> T f a #

min :: T f a -> T f a -> T f a #

(Show f, Show a) => Show (T f a) Source # 
Instance details

Defined in Data.Optional

Methods

showsPrec :: Int -> T f a -> ShowS #

show :: T f a -> String #

showList :: [T f a] -> ShowS #

(Arbitrary f, Arbitrary a) => Arbitrary (T f a) Source # 
Instance details

Defined in Data.Optional

Methods

arbitrary :: Gen (T f a) #

shrink :: T f a -> [T f a] #

(NFData f, NFData a) => NFData (T f a) Source # 
Instance details

Defined in Data.Optional

Methods

rnf :: T f a -> () #

(?:) :: a -> f a -> T f a infixr 5 Source #

fromEmpty :: T a -> T f a Source #

fromNonEmpty :: T f a -> T f a Source #