nonempty-vector-0.2.1.0: Non-empty vectors
Copyright(c) 2019-2020 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Vector.NonEmpty.Internal

Description

Internal module exposing the constructors for NonEmptyVector and NonEmptyMVector.

Warning: Since the constructors are exposed here, by using this module, you take on the risks that you break the non-emptiness invariants of the main modules. Use at your own risk.

Since: 0.2.1.0

Synopsis

Immutable boxed vectors

newtype NonEmptyVector a Source #

NonEmptyVector is a thin wrapper around Vector that witnesses an API requiring non-empty construction, initialization, and generation of non-empty vectors by design.

A newtype wrapper was chosen so that no new pointer indirection is introduced when working with Vectors, and all performance characteristics inherited from the Vector API still apply.

Since: 0.2.1.0

Constructors

NonEmptyVector 

Fields

Instances

Instances details
Monad NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Functor NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

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

Applicative NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Foldable NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

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

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

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

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

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

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

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

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

toList :: NonEmptyVector a -> [a] #

null :: NonEmptyVector a -> Bool #

length :: NonEmptyVector a -> Int #

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

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

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

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

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

Traversable NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

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

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

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

Eq1 NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

Ord1 NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

Read1 NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Show1 NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

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

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

MonadZip NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

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

Defined in Data.Vector.NonEmpty.Internal

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

Defined in Data.Vector.NonEmpty.Internal

Methods

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

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

toConstr :: NonEmptyVector a -> Constr #

dataTypeOf :: NonEmptyVector a -> DataType #

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

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

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

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

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

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

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

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

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

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

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

Defined in Data.Vector.NonEmpty.Internal

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

Defined in Data.Vector.NonEmpty.Internal

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

Defined in Data.Vector.NonEmpty.Internal

Semigroup (NonEmptyVector a) Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

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

Defined in Data.Vector.NonEmpty.Internal

Methods

rnf :: NonEmptyVector a -> () #

Mutable boxed vectors

newtype NonEmptyMVector s a Source #

NonEmptyMVector is a thin wrapper around MVector that witnesses an API requiring non-empty construction, initialization, and generation of non-empty vectors by design.

A newtype wrapper was chosen so that no new pointer indirection is introduced when working with MVectors, and all performance characteristics inherited from the MVector API still apply.

Since: 0.2.1.0

Constructors

NonEmptyMVector 

Fields

Mutable vector aliases

type NonEmptyIOVector = NonEmptyMVector RealWorld Source #

NonEmptyMVector parametrized by PrimState

Since: 0.2.1.0

type NonEmptySTVector s = NonEmptyMVector s Source #

NonEmptyMVector parametrized by ST

Since: 0.2.1.0