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
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
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 #