Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data LSeq (n :: Nat) a
- toSeq :: LSeq n a -> Seq a
- empty :: LSeq 0 a
- fromList :: Foldable f => f a -> LSeq 0 a
- fromNonEmpty :: NonEmpty a -> LSeq 1 a
- fromSeq :: Seq a -> LSeq 0 a
- toNonEmpty :: LSeq (1 + n) a -> NonEmpty a
- (<|) :: a -> LSeq n a -> LSeq (1 + n) a
- (|>) :: LSeq n a -> a -> LSeq (1 + n) a
- (><) :: LSeq n a -> LSeq m a -> LSeq (n + m) a
- eval :: forall proxy n m a. KnownNat n => proxy n -> LSeq m a -> Maybe (LSeq n a)
- index :: LSeq n a -> Int -> a
- adjust :: (a -> a) -> Int -> LSeq n a -> LSeq n a
- partition :: (a -> Bool) -> LSeq n a -> (LSeq 0 a, LSeq 0 a)
- mapWithIndex :: (Int -> a -> b) -> LSeq n a -> LSeq n b
- take :: Int -> LSeq n a -> LSeq 0 a
- drop :: Int -> LSeq n a -> LSeq 0 a
- unstableSortBy :: (a -> a -> Ordering) -> LSeq n a -> LSeq n a
- data ViewL n a where
- viewl :: LSeq (1 + n) a -> ViewL (1 + n) a
- pattern (:<|) :: forall (n :: Nat) a. () => forall (n1 :: Nat). (1 + n) ~# (1 + n1) => a -> LSeq n1 a -> LSeq (1 + n) a
- pattern (:<<) :: a -> LSeq 0 a -> LSeq n a
- pattern EmptyL :: LSeq n a
- data ViewR n a where
- viewr :: LSeq (1 + n) a -> ViewR (1 + n) a
- pattern (:|>) :: forall (n :: Nat) a. () => forall (n1 :: Nat). (1 + n) ~# (1 + n1) => LSeq n1 a -> a -> LSeq (1 + n) a
- promise :: LSeq m a -> LSeq n a
Documentation
data LSeq (n :: Nat) a Source #
LSeq n a certifies that the sequence has *at least* n items
Instances
Functor (LSeq n) Source # | |
Foldable (LSeq n) Source # | |
Defined in Data.Seq fold :: Monoid m => LSeq n m -> m # foldMap :: Monoid m => (a -> m) -> LSeq n a -> m # foldr :: (a -> b -> b) -> b -> LSeq n a -> b # foldr' :: (a -> b -> b) -> b -> LSeq n a -> b # foldl :: (b -> a -> b) -> b -> LSeq n a -> b # foldl' :: (b -> a -> b) -> b -> LSeq n a -> b # foldr1 :: (a -> a -> a) -> LSeq n a -> a # foldl1 :: (a -> a -> a) -> LSeq n a -> a # elem :: Eq a => a -> LSeq n a -> Bool # maximum :: Ord a => LSeq n a -> a # minimum :: Ord a => LSeq n a -> a # | |
Traversable (LSeq n) Source # | |
Eq a => Eq (LSeq n a) Source # | |
Ord a => Ord (LSeq n a) Source # | |
Read a => Read (LSeq n a) Source # | |
Show a => Show (LSeq n a) Source # | |
Semigroup (LSeq n a) Source # | |
Monoid (LSeq 0 a) Source # | |
(KnownNat n, Arbitrary a) => Arbitrary (LSeq n a) # | |
Ixed (LSeq n a) Source # | |
type Index (LSeq n a) Source # | |
type IxValue (LSeq n a) Source # | |
fromNonEmpty :: NonEmpty a -> LSeq 1 a Source #
index :: LSeq n a -> Int -> a Source #
get the element with index i, counting from the left and starting at 0. O(log(min(i,n-i)))
Instances
Functor (ViewL n) Source # | |
Foldable (ViewL n) Source # | |
Defined in Data.Seq fold :: Monoid m => ViewL n m -> m # foldMap :: Monoid m => (a -> m) -> ViewL n a -> m # foldr :: (a -> b -> b) -> b -> ViewL n a -> b # foldr' :: (a -> b -> b) -> b -> ViewL n a -> b # foldl :: (b -> a -> b) -> b -> ViewL n a -> b # foldl' :: (b -> a -> b) -> b -> ViewL n a -> b # foldr1 :: (a -> a -> a) -> ViewL n a -> a # foldl1 :: (a -> a -> a) -> ViewL n a -> a # elem :: Eq a => a -> ViewL n a -> Bool # maximum :: Ord a => ViewL n a -> a # minimum :: Ord a => ViewL n a -> a # | |
Traversable (ViewL n) Source # | |
Eq a => Eq (ViewL n a) Source # | |
Ord a => Ord (ViewL n a) Source # | |
Defined in Data.Seq | |
Show a => Show (ViewL n a) Source # | |
Semigroup (ViewL n a) Source # | |
pattern (:<|) :: forall (n :: Nat) a. () => forall (n1 :: Nat). (1 + n) ~# (1 + n1) => a -> LSeq n1 a -> LSeq (1 + n) a infixr 5 Source #
Instances
Functor (ViewR n) Source # | |
Foldable (ViewR n) Source # | |
Defined in Data.Seq fold :: Monoid m => ViewR n m -> m # foldMap :: Monoid m => (a -> m) -> ViewR n a -> m # foldr :: (a -> b -> b) -> b -> ViewR n a -> b # foldr' :: (a -> b -> b) -> b -> ViewR n a -> b # foldl :: (b -> a -> b) -> b -> ViewR n a -> b # foldl' :: (b -> a -> b) -> b -> ViewR n a -> b # foldr1 :: (a -> a -> a) -> ViewR n a -> a # foldl1 :: (a -> a -> a) -> ViewR n a -> a # elem :: Eq a => a -> ViewR n a -> Bool # maximum :: Ord a => ViewR n a -> a # minimum :: Ord a => ViewR n a -> a # | |
Traversable (ViewR n) Source # | |
Eq a => Eq (ViewR n a) Source # | |
Ord a => Ord (ViewR n a) Source # | |
Defined in Data.Seq | |
Show a => Show (ViewR n a) Source # | |
Semigroup (ViewR n a) Source # | |