nonempty-vector-0.2.4: Non-empty vectors
Copyright(c) 2019-2024 Emily Pillmore
LicenseBSD-style
MaintainerEmily Pillmore <emilypi@cohomolo.gy>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
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
MonadZip 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

Foldable1 NonEmptyVector Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

fold1 :: Semigroup m => NonEmptyVector m -> m

foldMap1 :: Semigroup m => (a -> m) -> NonEmptyVector a -> m

foldMap1' :: Semigroup m => (a -> m) -> NonEmptyVector a -> m

toNonEmpty :: NonEmptyVector a -> NonEmpty a

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

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

head :: NonEmptyVector a -> a

last :: NonEmptyVector a -> a

foldrMap1 :: (a -> b) -> (a -> b -> b) -> NonEmptyVector a -> b

foldlMap1' :: (a -> b) -> (b -> a -> b) -> NonEmptyVector a -> b

foldlMap1 :: (a -> b) -> (b -> a -> b) -> NonEmptyVector a -> b

foldrMap1' :: (a -> b) -> (a -> b -> b) -> NonEmptyVector a -> b

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

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmptyVector a)

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmptyVector a]

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmptyVector a)

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmptyVector a]

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

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)

Applicative 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

Monad NonEmptyVector 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)

Semigroup (NonEmptyVector a) Source # 
Instance details

Defined in Data.Vector.NonEmpty.Internal

Methods

(<>) :: NonEmptyVector a -> NonEmptyVector a -> NonEmptyVector a

sconcat :: NonEmpty (NonEmptyVector a) -> NonEmptyVector a

stimes :: Integral b => b -> NonEmptyVector a -> NonEmptyVector a

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

Defined in Data.Vector.NonEmpty.Internal

Methods

readsPrec :: Int -> ReadS (NonEmptyVector a)

readList :: ReadS [NonEmptyVector a]

readPrec :: ReadPrec (NonEmptyVector a)

readListPrec :: ReadPrec [NonEmptyVector a]

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

Defined in Data.Vector.NonEmpty.Internal

Methods

showsPrec :: Int -> NonEmptyVector a -> ShowS

show :: NonEmptyVector a -> String

showList :: [NonEmptyVector a] -> ShowS

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

Defined in Data.Vector.NonEmpty.Internal

Methods

rnf :: NonEmptyVector a -> ()

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

Defined in Data.Vector.NonEmpty.Internal

Methods

(==) :: NonEmptyVector a -> NonEmptyVector a -> Bool

(/=) :: NonEmptyVector a -> NonEmptyVector a -> Bool

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

Defined in Data.Vector.NonEmpty.Internal

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