Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Non-empty length-indexed random access list.
Synopsis
- newtype NERAVec (b :: BinP) a = NE (NERAVec' 'Z b a)
- data NERAVec' (n :: Nat) (b :: BinP) a where
- singleton :: forall a. a -> NERAVec BinP1 a
- singleton' :: a -> NERAVec' 'Z BinP1 a
- cons :: forall a b. a -> NERAVec b a -> NERAVec (Succ b) a
- consTree :: Tree n a -> NERAVec' n b a -> NERAVec' n (Succ b) a
- withCons :: SBinPI b => a -> NERAVec b a -> (SBinPI (Succ b) => NERAVec (Succ b) a -> r) -> r
- withConsTree :: SBinP b -> Tree n a -> NERAVec' n b a -> (SBinPI (Succ b) => NERAVec' n (Succ b) a -> r) -> r
- toList :: NERAVec b a -> [a]
- toList' :: NERAVec' n b a -> [a]
- toNonEmpty :: NERAVec b a -> NonEmpty a
- toNonEmpty' :: NERAVec' n b a -> NonEmpty a
- reifyNonEmpty :: NonEmpty a -> (forall b. SBinPI b => NERAVec b a -> r) -> r
- reifyNonEmpty' :: forall a r. NonEmpty a -> (forall b. SBinPI b => NERAVec' 'Z b a -> r) -> r
- (!) :: NERAVec b a -> PosP b -> a
- index' :: NERAVec' n b a -> PosP' n b -> a
- tabulate :: SBinPI b => (PosP b -> a) -> NERAVec b a
- tabulate' :: forall b n a. (SBinPI b, SNatI n) => (PosP' n b -> a) -> NERAVec' n b a
- unsingleton :: NERAVec 'BE a -> a
- head :: NERAVec b a -> a
- head' :: NERAVec' n b a -> a
- last :: NERAVec b a -> a
- last' :: NERAVec' n b a -> a
- foldMap :: Monoid m => (a -> m) -> NERAVec b a -> m
- foldMap' :: Monoid m => (a -> m) -> NERAVec' n b a -> m
- foldMap1 :: Semigroup m => (a -> m) -> NERAVec b a -> m
- foldMap1' :: Semigroup m => (a -> m) -> NERAVec' n b a -> m
- ifoldMap :: Monoid m => (PosP b -> a -> m) -> NERAVec b a -> m
- ifoldMap' :: Monoid m => (PosP' n b -> a -> m) -> NERAVec' n b a -> m
- ifoldMap1 :: Semigroup m => (PosP b -> a -> m) -> NERAVec b a -> m
- ifoldMap1' :: Semigroup m => (PosP' n b -> a -> m) -> NERAVec' n b a -> m
- foldr :: (a -> b -> b) -> b -> NERAVec m a -> b
- foldr' :: (a -> b -> b) -> b -> NERAVec' n m a -> b
- ifoldr :: (PosP m -> a -> b -> b) -> b -> NERAVec m a -> b
- ifoldr' :: (PosP' n m -> a -> b -> b) -> b -> NERAVec' n m a -> b
- foldr1Map :: (a -> b -> b) -> (a -> b) -> NERAVec m a -> b
- foldr1Map' :: (a -> b -> b) -> (a -> b) -> NERAVec' n m a -> b
- ifoldr1Map :: (PosP m -> a -> b -> b) -> (PosP m -> a -> b) -> NERAVec m a -> b
- ifoldr1Map' :: (PosP' n m -> a -> b -> b) -> (PosP' n m -> a -> b) -> NERAVec' n m a -> b
- map :: (a -> b) -> NERAVec m a -> NERAVec m b
- map' :: (a -> b) -> NERAVec' n m a -> NERAVec' n m b
- imap :: (PosP m -> a -> b) -> NERAVec m a -> NERAVec m b
- imap' :: (PosP' n m -> a -> b) -> NERAVec' n m a -> NERAVec' n m b
- traverse :: Applicative f => (a -> f b) -> NERAVec m a -> f (NERAVec m b)
- traverse' :: Applicative f => (a -> f b) -> NERAVec' n m a -> f (NERAVec' n m b)
- itraverse :: Applicative f => (PosP m -> a -> f b) -> NERAVec m a -> f (NERAVec m b)
- itraverse' :: Applicative f => (PosP' n m -> a -> f b) -> NERAVec' n m a -> f (NERAVec' n m b)
- traverse1 :: Apply f => (a -> f b) -> NERAVec m a -> f (NERAVec m b)
- traverse1' :: Apply f => (a -> f b) -> NERAVec' n m a -> f (NERAVec' n m b)
- itraverse1 :: Apply f => (PosP m -> a -> f b) -> NERAVec m a -> f (NERAVec m b)
- itraverse1' :: Apply f => (PosP' n m -> a -> f b) -> NERAVec' n m a -> f (NERAVec' n m b)
- zipWith :: (a -> b -> c) -> NERAVec m a -> NERAVec m b -> NERAVec m c
- zipWith' :: (a -> b -> c) -> NERAVec' n m a -> NERAVec' n m b -> NERAVec' n m c
- izipWith :: (PosP m -> a -> b -> c) -> NERAVec m a -> NERAVec m b -> NERAVec m c
- izipWith' :: (PosP' n m -> a -> b -> c) -> NERAVec' n m a -> NERAVec' n m b -> NERAVec' n m c
- repeat :: SBinPI b => a -> NERAVec b a
- repeat' :: forall b n a. (SNatI n, SBinPI b) => a -> NERAVec' n b a
- universe :: forall b. SBinPI b => NERAVec b (PosP b)
- universe' :: forall n b. (SNatI n, SBinPI b) => NERAVec' n b (PosP' n b)
- liftArbitrary :: SBinPI b => Gen a -> Gen (NERAVec b a)
- liftArbitrary' :: forall b n a. (SBinPI b, SNatI n) => Gen a -> Gen (NERAVec' n b a)
- liftShrink :: (a -> [a]) -> NERAVec b a -> [NERAVec b a]
- liftShrink' :: forall b n a. (a -> [a]) -> NERAVec' n b a -> [NERAVec' n b a]
Random access list
newtype NERAVec (b :: BinP) a Source #
Non-empty random access list.
Instances
SBinPI b => Arbitrary1 (NERAVec b) Source # | |
Defined in Data.RAVec.NonEmpty liftArbitrary :: Gen a -> Gen (NERAVec b a) # liftShrink :: (a -> [a]) -> NERAVec b a -> [NERAVec b a] # | |
SBinPI b => Representable (NERAVec b) Source # | |
Foldable (NERAVec b) Source # | |
Defined in Data.RAVec.NonEmpty fold :: Monoid m => NERAVec b m -> m # foldMap :: Monoid m => (a -> m) -> NERAVec b a -> m # foldMap' :: Monoid m => (a -> m) -> NERAVec b a -> m # foldr :: (a -> b0 -> b0) -> b0 -> NERAVec b a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> NERAVec b a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> NERAVec b a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> NERAVec b a -> b0 # foldr1 :: (a -> a -> a) -> NERAVec b a -> a # foldl1 :: (a -> a -> a) -> NERAVec b a -> a # toList :: NERAVec b a -> [a] # length :: NERAVec b a -> Int # elem :: Eq a => a -> NERAVec b a -> Bool # maximum :: Ord a => NERAVec b a -> a # minimum :: Ord a => NERAVec b a -> a # | |
Foldable1 (NERAVec b) Source # | |
Defined in Data.RAVec.NonEmpty fold1 :: Semigroup m => NERAVec b m -> m # foldMap1 :: Semigroup m => (a -> m) -> NERAVec b a -> m # foldMap1' :: Semigroup m => (a -> m) -> NERAVec b a -> m # toNonEmpty :: NERAVec b a -> NonEmpty a # maximum :: Ord a => NERAVec b a -> a # minimum :: Ord a => NERAVec b a -> a # foldrMap1 :: (a -> b0) -> (a -> b0 -> b0) -> NERAVec b a -> b0 # foldlMap1' :: (a -> b0) -> (b0 -> a -> b0) -> NERAVec b a -> b0 # foldlMap1 :: (a -> b0) -> (b0 -> a -> b0) -> NERAVec b a -> b0 # foldrMap1' :: (a -> b0) -> (a -> b0 -> b0) -> NERAVec b a -> b0 # | |
Traversable (NERAVec b) Source # | |
Defined in Data.RAVec.NonEmpty | |
SBinPI b => Applicative (NERAVec b) Source # | |
Functor (NERAVec b) Source # | |
SBinPI b => Distributive (NERAVec b) Source # | |
Apply (NERAVec b) Source # | |
Traversable1 (NERAVec b) Source # | |
FoldableWithIndex (PosP n) (NERAVec n) Source # | Since: 0.2 |
Defined in Data.RAVec.NonEmpty ifoldMap :: Monoid m => (PosP n -> a -> m) -> NERAVec n a -> m # ifoldMap' :: Monoid m => (PosP n -> a -> m) -> NERAVec n a -> m # ifoldr :: (PosP n -> a -> b -> b) -> b -> NERAVec n a -> b # ifoldl :: (PosP n -> b -> a -> b) -> b -> NERAVec n a -> b # ifoldr' :: (PosP n -> a -> b -> b) -> b -> NERAVec n a -> b # ifoldl' :: (PosP n -> b -> a -> b) -> b -> NERAVec n a -> b # | |
FunctorWithIndex (PosP n) (NERAVec n) Source # | Since: 0.2 |
TraversableWithIndex (PosP n) (NERAVec n) Source # | Since: 0.2 |
Defined in Data.RAVec.NonEmpty | |
(SBinPI b, Arbitrary a) => Arbitrary (NERAVec b a) Source # | |
CoArbitrary a => CoArbitrary (NERAVec b a) Source # | |
Defined in Data.RAVec.NonEmpty coarbitrary :: NERAVec b a -> Gen b0 -> Gen b0 # | |
(SBinPI b, Function a) => Function (NERAVec b a) Source # | |
(Monoid a, SBinPI b) => Monoid (NERAVec b a) Source # | |
Semigroup a => Semigroup (NERAVec b a) Source # | |
Show a => Show (NERAVec b a) Source # | |
NFData a => NFData (NERAVec b a) Source # | |
Defined in Data.RAVec.NonEmpty | |
Eq a => Eq (NERAVec b a) Source # | |
Ord a => Ord (NERAVec b a) Source # | |
Defined in Data.RAVec.NonEmpty | |
Hashable a => Hashable (NERAVec b a) Source # | |
Defined in Data.RAVec.NonEmpty | |
type Rep (NERAVec b) Source # | |
Defined in Data.RAVec.NonEmpty |
data NERAVec' (n :: Nat) (b :: BinP) a where Source #
Non-empty random access list, undelying representation.
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
(SBinPI b, SNatI n) => Arbitrary1 (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty liftArbitrary :: Gen a -> Gen (NERAVec' n b a) # liftShrink :: (a -> [a]) -> NERAVec' n b a -> [NERAVec' n b a] # | |
(SBinPI b, SNatI n) => Representable (NERAVec' n b) Source # | |
Foldable (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty fold :: Monoid m => NERAVec' n b m -> m # foldMap :: Monoid m => (a -> m) -> NERAVec' n b a -> m # foldMap' :: Monoid m => (a -> m) -> NERAVec' n b a -> m # foldr :: (a -> b0 -> b0) -> b0 -> NERAVec' n b a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> NERAVec' n b a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> NERAVec' n b a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> NERAVec' n b a -> b0 # foldr1 :: (a -> a -> a) -> NERAVec' n b a -> a # foldl1 :: (a -> a -> a) -> NERAVec' n b a -> a # toList :: NERAVec' n b a -> [a] # null :: NERAVec' n b a -> Bool # length :: NERAVec' n b a -> Int # elem :: Eq a => a -> NERAVec' n b a -> Bool # maximum :: Ord a => NERAVec' n b a -> a # minimum :: Ord a => NERAVec' n b a -> a # | |
Foldable1 (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty fold1 :: Semigroup m => NERAVec' n b m -> m # foldMap1 :: Semigroup m => (a -> m) -> NERAVec' n b a -> m # foldMap1' :: Semigroup m => (a -> m) -> NERAVec' n b a -> m # toNonEmpty :: NERAVec' n b a -> NonEmpty a # maximum :: Ord a => NERAVec' n b a -> a # minimum :: Ord a => NERAVec' n b a -> a # foldrMap1 :: (a -> b0) -> (a -> b0 -> b0) -> NERAVec' n b a -> b0 # foldlMap1' :: (a -> b0) -> (b0 -> a -> b0) -> NERAVec' n b a -> b0 # foldlMap1 :: (a -> b0) -> (b0 -> a -> b0) -> NERAVec' n b a -> b0 # foldrMap1' :: (a -> b0) -> (a -> b0 -> b0) -> NERAVec' n b a -> b0 # | |
Traversable (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty | |
(SBinPI b, SNatI n) => Applicative (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty | |
Functor (NERAVec' n b) Source # | |
(SBinPI b, SNatI n) => Distributive (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty | |
Apply (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty | |
Traversable1 (NERAVec' n b) Source # | |
FoldableWithIndex (PosP' n m) (NERAVec' n m) Source # | Since: 0.2 |
Defined in Data.RAVec.NonEmpty ifoldMap :: Monoid m0 => (PosP' n m -> a -> m0) -> NERAVec' n m a -> m0 # ifoldMap' :: Monoid m0 => (PosP' n m -> a -> m0) -> NERAVec' n m a -> m0 # ifoldr :: (PosP' n m -> a -> b -> b) -> b -> NERAVec' n m a -> b # ifoldl :: (PosP' n m -> b -> a -> b) -> b -> NERAVec' n m a -> b # ifoldr' :: (PosP' n m -> a -> b -> b) -> b -> NERAVec' n m a -> b # ifoldl' :: (PosP' n m -> b -> a -> b) -> b -> NERAVec' n m a -> b # | |
FunctorWithIndex (PosP' n m) (NERAVec' n m) Source # | Since: 0.2 |
TraversableWithIndex (PosP' n m) (NERAVec' n m) Source # | Since: 0.2 |
Defined in Data.RAVec.NonEmpty | |
CoArbitrary a => CoArbitrary (NERAVec' n b a) Source # | |
Defined in Data.RAVec.NonEmpty coarbitrary :: NERAVec' n b a -> Gen b0 -> Gen b0 # | |
(SNatI n, SBinPI b, Function a) => Function (NERAVec' n b a) Source # | |
(Monoid a, SBinPI b, SNatI n) => Monoid (NERAVec' n b a) Source # | |
Semigroup a => Semigroup (NERAVec' n b a) Source # | |
Show a => Show (NERAVec' n b a) Source # | |
NFData a => NFData (NERAVec' n b a) Source # | |
Defined in Data.RAVec.NonEmpty | |
Eq a => Eq (NERAVec' n b a) Source # | |
Ord a => Ord (NERAVec' n b a) Source # | |
Defined in Data.RAVec.NonEmpty compare :: NERAVec' n b a -> NERAVec' n b a -> Ordering # (<) :: NERAVec' n b a -> NERAVec' n b a -> Bool # (<=) :: NERAVec' n b a -> NERAVec' n b a -> Bool # (>) :: NERAVec' n b a -> NERAVec' n b a -> Bool # (>=) :: NERAVec' n b a -> NERAVec' n b a -> Bool # | |
Hashable a => Hashable (NERAVec' n b a) Source # | |
Defined in Data.RAVec.NonEmpty | |
type Rep (NERAVec' n b) Source # | |
Defined in Data.RAVec.NonEmpty |
Construction
withCons :: SBinPI b => a -> NERAVec b a -> (SBinPI (Succ b) => NERAVec (Succ b) a -> r) -> r Source #
withCons
for non-empty rals.
withConsTree :: SBinP b -> Tree n a -> NERAVec' n b a -> (SBinPI (Succ b) => NERAVec' n (Succ b) a -> r) -> r Source #
Conversion
toNonEmpty :: NERAVec b a -> NonEmpty a Source #
toNonEmpty' :: NERAVec' n b a -> NonEmpty a Source #
reifyNonEmpty' :: forall a r. NonEmpty a -> (forall b. SBinPI b => NERAVec' 'Z b a -> r) -> r Source #
Indexing
unsingleton :: NERAVec 'BE a -> a Source #
Folds
foldr1Map' :: (a -> b -> b) -> (a -> b) -> NERAVec' n m a -> b Source #
Mapping
itraverse' :: Applicative f => (PosP' n m -> a -> f b) -> NERAVec' n m a -> f (NERAVec' n m b) Source #
Zipping
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' n m -> a -> b -> c) -> NERAVec' n m a -> NERAVec' n m b -> NERAVec' n m c Source #
Universe
QuickCheck
liftShrink :: (a -> [a]) -> NERAVec b a -> [NERAVec b a] Source #
liftShrink' :: forall b n a. (a -> [a]) -> NERAVec' n b a -> [NERAVec' n b a] Source #