ral-0.1: Random access lists
Safe Haskell None
Language Haskell2010

Data.RAVec.NonEmpty

Description

Non-empty length-indexed random access list.

Synopsis

Random access list

newtype NERAVec (b :: BinP ) a Source #

Non-empty random access list.

Constructors

NE ( NERAVec' ' Z b a)

Instances

Instances details
Functor ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

fmap :: (a -> b0) -> NERAVec b a -> NERAVec b b0 Source #

(<$) :: a -> NERAVec b b0 -> NERAVec b a Source #

SBinPI b => Applicative ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Foldable ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Traversable ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

SBinPI b => Arbitrary1 ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

SBinPI b => Distributive ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

SBinPI b => Representable ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Associated Types

type Rep ( NERAVec b) Source #

Traversable1 ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

traverse1 :: Apply f => (a -> f b0) -> NERAVec b a -> f ( NERAVec b b0) Source #

sequence1 :: Apply f => NERAVec b (f b0) -> f ( NERAVec b b0) Source #

Apply ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Foldable1 ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Eq a => Eq ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Ord a => Ord ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Show a => Show ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Semigroup a => Semigroup ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( Monoid a, SBinPI b) => Monoid ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( SBinPI b, Function a) => Function ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( SBinPI b, Arbitrary a) => Arbitrary ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

CoArbitrary a => CoArbitrary ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

NFData a => NFData ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

rnf :: NERAVec b a -> () Source #

Hashable a => Hashable ( NERAVec b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

type Rep ( NERAVec b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

data NERAVec' (n :: Nat ) (b :: BinP ) a where Source #

Non-empty random access list, undelying representation.

Constructors

Last :: Tree n a -> NERAVec' n ' BE a
Cons0 :: NERAVec' (' S n) b a -> NERAVec' n (' B0 b) a
Cons1 :: Tree n a -> NERAVec' (' S n) b a -> NERAVec' n (' B1 b) a

Instances

Instances details
Functor ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

fmap :: (a -> b0) -> NERAVec' n b a -> NERAVec' n b b0 Source #

(<$) :: a -> NERAVec' n b b0 -> NERAVec' n b a Source #

( SBinPI b, SNatI n) => Applicative ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Foldable ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

fold :: Monoid m => NERAVec' n b m -> m Source #

foldMap :: Monoid m => (a -> m) -> NERAVec' n b a -> m Source #

foldMap' :: Monoid m => (a -> m) -> NERAVec' n b a -> m Source #

foldr :: (a -> b0 -> b0) -> b0 -> NERAVec' n b a -> b0 Source #

foldr' :: (a -> b0 -> b0) -> b0 -> NERAVec' n b a -> b0 Source #

foldl :: (b0 -> a -> b0) -> b0 -> NERAVec' n b a -> b0 Source #

foldl' :: (b0 -> a -> b0) -> b0 -> NERAVec' n b a -> b0 Source #

foldr1 :: (a -> a -> a) -> NERAVec' n b a -> a Source #

foldl1 :: (a -> a -> a) -> NERAVec' n b a -> a Source #

toList :: NERAVec' n b a -> [a] Source #

null :: NERAVec' n b a -> Bool Source #

length :: NERAVec' n b a -> Int Source #

elem :: Eq a => a -> NERAVec' n b a -> Bool Source #

maximum :: Ord a => NERAVec' n b a -> a Source #

minimum :: Ord a => NERAVec' n b a -> a Source #

sum :: Num a => NERAVec' n b a -> a Source #

product :: Num a => NERAVec' n b a -> a Source #

Traversable ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

traverse :: Applicative f => (a -> f b0) -> NERAVec' n b a -> f ( NERAVec' n b b0) Source #

sequenceA :: Applicative f => NERAVec' n b (f a) -> f ( NERAVec' n b a) Source #

mapM :: Monad m => (a -> m b0) -> NERAVec' n b a -> m ( NERAVec' n b b0) Source #

sequence :: Monad m => NERAVec' n b (m a) -> m ( NERAVec' n b a) Source #

( SBinPI b, SNatI n) => Arbitrary1 ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( SBinPI b, SNatI n) => Distributive ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

distribute :: Functor f => f ( NERAVec' n b a) -> NERAVec' n b (f a) Source #

collect :: Functor f => (a -> NERAVec' n b b0) -> f a -> NERAVec' n b (f b0) Source #

distributeM :: Monad m => m ( NERAVec' n b a) -> NERAVec' n b (m a) Source #

collectM :: Monad m => (a -> NERAVec' n b b0) -> m a -> NERAVec' n b (m b0) Source #

( SBinPI b, SNatI n) => Representable ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Associated Types

type Rep ( NERAVec' n b) Source #

Traversable1 ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

traverse1 :: Apply f => (a -> f b0) -> NERAVec' n b a -> f ( NERAVec' n b b0) Source #

sequence1 :: Apply f => NERAVec' n b (f b0) -> f ( NERAVec' n b b0) Source #

Apply ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Foldable1 ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Eq a => Eq ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Ord a => Ord ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Show a => Show ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Semigroup a => Semigroup ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( Monoid a, SBinPI b, SNatI n) => Monoid ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

( SNatI n, SBinPI b, Function a) => Function ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

function :: ( NERAVec' n b a -> b0) -> NERAVec' n b a :-> b0 Source #

CoArbitrary a => CoArbitrary ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

NFData a => NFData ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

Methods

rnf :: NERAVec' n b a -> () Source #

Hashable a => Hashable ( NERAVec' n b a) Source #
Instance details

Defined in Data.RAVec.NonEmpty

type Rep ( NERAVec' n b) Source #
Instance details

Defined in Data.RAVec.NonEmpty

type Rep ( NERAVec' n b) = PosP' n b

Construction

cons :: forall a b. a -> NERAVec b a -> NERAVec ( Succ b) a Source #

cons for non-empty rals.

withCons :: SBinPI b => a -> NERAVec b a -> ( SBinPI ( Succ b) => NERAVec ( Succ b) a -> r) -> r Source #

withCons for non-empty rals.

Conversion

reifyNonEmpty' :: forall a r. NonEmpty a -> ( forall b. SBinPI b => NERAVec' ' Z b a -> r) -> r Source #

Indexing

tabulate' :: forall b n a. ( SBinPI b, SNatI n) => ( PosP' n b -> a) -> NERAVec' n b a Source #

Folds

foldMap :: Monoid m => (a -> m) -> NERAVec b a -> m Source #

foldMap' :: Monoid m => (a -> m) -> NERAVec' n b a -> m Source #

ifoldMap :: Monoid m => ( PosP b -> a -> m) -> NERAVec b a -> m Source #

ifoldMap' :: Monoid m => ( PosP' n b -> a -> m) -> NERAVec' n b a -> m Source #

ifoldMap1' :: Semigroup m => ( PosP' n b -> a -> m) -> NERAVec' n b a -> m Source #

foldr :: (a -> b -> b) -> b -> NERAVec m a -> b Source #

foldr' :: (a -> b -> b) -> b -> NERAVec' n m a -> b Source #

ifoldr :: ( PosP m -> a -> b -> b) -> b -> NERAVec m a -> b Source #

ifoldr' :: ( PosP' n m -> a -> b -> b) -> b -> NERAVec' n m a -> b Source #

foldr1Map :: (a -> b -> b) -> (a -> b) -> NERAVec m a -> b Source #

foldr1Map' :: (a -> b -> b) -> (a -> b) -> NERAVec' n m a -> b Source #

ifoldr1Map :: ( PosP m -> a -> b -> b) -> ( PosP m -> a -> b) -> NERAVec m a -> b Source #

ifoldr1Map' :: ( PosP' n m -> a -> b -> b) -> ( PosP' n m -> a -> b) -> NERAVec' n m a -> b Source #

Mapping

map' :: (a -> b) -> NERAVec' n m a -> NERAVec' n m b Source #

imap' :: ( PosP' n m -> a -> b) -> NERAVec' n m a -> NERAVec' n m b Source #

traverse' :: Applicative f => (a -> f b) -> NERAVec' n m a -> f ( NERAVec' n m b) Source #

itraverse' :: Applicative f => ( PosP' n m -> a -> f b) -> NERAVec' n m a -> f ( NERAVec' n m b) Source #

traverse1 :: Apply f => (a -> f b) -> NERAVec m a -> f ( NERAVec m b) Source #

traverse1' :: Apply f => (a -> f b) -> NERAVec' n m a -> f ( NERAVec' n m b) Source #

itraverse1 :: Apply f => ( PosP m -> a -> f b) -> NERAVec m a -> f ( NERAVec m b) Source #

itraverse1' :: Apply f => ( PosP' n m -> a -> f b) -> NERAVec' n m a -> f ( NERAVec' n m b) Source #

Zipping

zipWith :: (a -> b -> c) -> NERAVec m a -> NERAVec m b -> NERAVec m c Source #

zipWith' :: (a -> b -> c) -> NERAVec' n m a -> NERAVec' n m b -> NERAVec' n m c Source #

Zip two NERAVec' s with a function.

izipWith :: ( PosP m -> a -> b -> c) -> NERAVec m a -> NERAVec m b -> NERAVec m c Source #

izipWith' :: ( PosP' n m -> a -> b -> c) -> NERAVec' n m a -> NERAVec' n m b -> NERAVec' n m c Source #

Zip two NERAVec' s with a function which also takes PosP' index.

repeat' :: forall b n a. ( SNatI n, SBinPI b) => a -> NERAVec' n b a Source #

Universe

QuickCheck

liftShrink' :: forall b n a. (a -> [a]) -> NERAVec' n b a -> [ NERAVec' n b a] Source #