Safe Haskell | None |
---|---|
Language | Haskell2010 |
Warning: This module should be considered highly experimental.
- class (Integral (Index seq), GrowingAppend seq) => SemiSequence seq where
- singleton :: IsSequence seq => Element seq -> seq
- class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq where
- fromList :: [Element seq] -> seq
- break :: (Element seq -> Bool) -> seq -> (seq, seq)
- span :: (Element seq -> Bool) -> seq -> (seq, seq)
- dropWhile :: (Element seq -> Bool) -> seq -> seq
- takeWhile :: (Element seq -> Bool) -> seq -> seq
- splitAt :: Index seq -> seq -> (seq, seq)
- unsafeSplitAt :: Index seq -> seq -> (seq, seq)
- take :: Index seq -> seq -> seq
- unsafeTake :: Index seq -> seq -> seq
- drop :: Index seq -> seq -> seq
- unsafeDrop :: Index seq -> seq -> seq
- partition :: (Element seq -> Bool) -> seq -> (seq, seq)
- uncons :: seq -> Maybe (Element seq, seq)
- unsnoc :: seq -> Maybe (seq, Element seq)
- filter :: (Element seq -> Bool) -> seq -> seq
- filterM :: Monad m => (Element seq -> m Bool) -> seq -> m seq
- replicate :: Index seq -> Element seq -> seq
- replicateM :: Monad m => Index seq -> m (Element seq) -> m seq
- groupBy :: (Element seq -> Element seq -> Bool) -> seq -> [seq]
- groupAllOn :: Eq b => (Element seq -> b) -> seq -> [seq]
- subsequences :: seq -> [seq]
- permutations :: seq -> [seq]
- tailEx :: seq -> seq
- initEx :: seq -> seq
- unsafeTail :: seq -> seq
- unsafeInit :: seq -> seq
- defaultFind :: MonoFoldable seq => (Element seq -> Bool) -> seq -> Maybe (Element seq)
- defaultIntersperse :: IsSequence seq => Element seq -> seq -> seq
- defaultReverse :: IsSequence seq => seq -> seq
- defaultSortBy :: IsSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq
- vectorSortBy :: Vector v e => (e -> e -> Ordering) -> v e -> v e
- vectorSort :: (Vector v e, Ord e) => v e -> v e
- defaultCons :: IsSequence seq => Element seq -> seq -> seq
- defaultSnoc :: IsSequence seq => seq -> Element seq -> seq
- tailDef :: IsSequence seq => seq -> seq
- initDef :: IsSequence seq => seq -> seq
- class (IsSequence seq, Eq (Element seq)) => EqSequence seq where
- stripPrefix :: seq -> seq -> Maybe seq
- isPrefixOf :: seq -> seq -> Bool
- stripSuffix :: seq -> seq -> Maybe seq
- isSuffixOf :: seq -> seq -> Bool
- isInfixOf :: seq -> seq -> Bool
- group :: seq -> [seq]
- groupAll :: seq -> [seq]
- elem :: Element seq -> seq -> Bool
- notElem :: Element seq -> seq -> Bool
- class (EqSequence seq, MonoFoldableOrd seq) => OrdSequence seq where
- sort :: seq -> seq
- class (IsSequence t, IsString t, Element t ~ Char) => Textual t where
- catMaybes :: (IsSequence (f (Maybe t)), Functor f, Element (f (Maybe t)) ~ Maybe t) => f (Maybe t) -> f t
Documentation
class (Integral (Index seq), GrowingAppend seq) => SemiSequence seq where Source
SemiSequence
was created to share code between IsSequence
and NonNull
.
You should always use IsSequence
or NonNull
rather than using SemiSequence
SemiSequence
is exported so that you can define new instances of IsSequence
or NonNull
Semi
means SemiGroup
A SemiSequence
can accomodate a SemiGroup
such as NonEmpty
A Monoid should be able to fill out IsSequence
As a base for NonNull
,
a SemiSequence
keeps the same type when increasing its number of elements.
However, a decreasing function such as filter may change a NonNull
type.
For example, from NonEmpty
to '[]'
This exists on NonNull
as nfilter
filter
and other such functions are placed in IsSequence
intersperse :: Element seq -> seq -> seq Source
find :: (Element seq -> Bool) -> seq -> Maybe (Element seq) Source
sortBy :: (Element seq -> Element seq -> Ordering) -> seq -> seq Source
SemiSequence ByteString | |
SemiSequence ByteString | |
SemiSequence Text | |
SemiSequence Text | |
SemiSequence [a] | |
SemiSequence (Seq a) | |
SemiSequence (DList a) | |
SemiSequence (NonEmpty a) | |
SemiSequence (Vector a) | |
Unbox a => SemiSequence (Vector a) | |
Storable a => SemiSequence (Vector a) | |
SemiSequence seq => SemiSequence (MinLen nat seq) |
singleton :: IsSequence seq => Element seq -> seq Source
class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq where Source
Sequence Laws:
fromList . otoList = id fromList (x <> y) = fromList x <> fromList y otoList (fromList x <> fromList y) = x <> y
Nothing
fromList :: [Element seq] -> seq Source
break :: (Element seq -> Bool) -> seq -> (seq, seq) Source
span :: (Element seq -> Bool) -> seq -> (seq, seq) Source
dropWhile :: (Element seq -> Bool) -> seq -> seq Source
takeWhile :: (Element seq -> Bool) -> seq -> seq Source
splitAt :: Index seq -> seq -> (seq, seq) Source
unsafeSplitAt :: Index seq -> seq -> (seq, seq) Source
take :: Index seq -> seq -> seq Source
unsafeTake :: Index seq -> seq -> seq Source
drop :: Index seq -> seq -> seq Source
unsafeDrop :: Index seq -> seq -> seq Source
partition :: (Element seq -> Bool) -> seq -> (seq, seq) Source
uncons :: seq -> Maybe (Element seq, seq) Source
unsnoc :: seq -> Maybe (seq, Element seq) Source
filter :: (Element seq -> Bool) -> seq -> seq Source
filterM :: Monad m => (Element seq -> m Bool) -> seq -> m seq Source
replicate :: Index seq -> Element seq -> seq Source
replicateM :: Monad m => Index seq -> m (Element seq) -> m seq Source
groupBy :: (Element seq -> Element seq -> Bool) -> seq -> [seq] Source
groupAllOn :: Eq b => (Element seq -> b) -> seq -> [seq] Source
Similar to standard groupBy
, but operates on the whole collection,
not just the consecutive items.
subsequences :: seq -> [seq] Source
permutations :: seq -> [seq] Source
unsafeTail :: seq -> seq Source
unsafeInit :: seq -> seq Source
IsSequence ByteString | |
IsSequence ByteString | |
IsSequence Text | |
IsSequence Text | |
IsSequence [a] | |
IsSequence (Seq a) | |
IsSequence (DList a) | |
IsSequence (Vector a) | |
Unbox a => IsSequence (Vector a) | |
Storable a => IsSequence (Vector a) |
defaultFind :: MonoFoldable seq => (Element seq -> Bool) -> seq -> Maybe (Element seq) Source
defaultIntersperse :: IsSequence seq => Element seq -> seq -> seq Source
defaultReverse :: IsSequence seq => seq -> seq Source
defaultSortBy :: IsSequence seq => (Element seq -> Element seq -> Ordering) -> seq -> seq Source
vectorSortBy :: Vector v e => (e -> e -> Ordering) -> v e -> v e Source
vectorSort :: (Vector v e, Ord e) => v e -> v e Source
defaultCons :: IsSequence seq => Element seq -> seq -> seq Source
defaultSnoc :: IsSequence seq => seq -> Element seq -> seq Source
tailDef :: IsSequence seq => seq -> seq Source
like Data.List.tail, but an input of mempty
returns mempty
initDef :: IsSequence seq => seq -> seq Source
like Data.List.init, but an input of mempty
returns mempty
class (IsSequence seq, Eq (Element seq)) => EqSequence seq where Source
Nothing
stripPrefix :: seq -> seq -> Maybe seq Source
isPrefixOf :: seq -> seq -> Bool Source
stripSuffix :: seq -> seq -> Maybe seq Source
isSuffixOf :: seq -> seq -> Bool Source
isInfixOf :: seq -> seq -> Bool Source
groupAll :: seq -> [seq] Source
Similar to standard group
, but operates on the whole collection,
not just the consecutive items.
EqSequence ByteString | |
EqSequence ByteString | |
EqSequence Text | |
EqSequence Text | |
Eq a => EqSequence [a] | |
Eq a => EqSequence (Seq a) | |
Eq a => EqSequence (Vector a) | |
(Eq a, Unbox a) => EqSequence (Vector a) | |
(Eq a, Storable a) => EqSequence (Vector a) |
class (EqSequence seq, MonoFoldableOrd seq) => OrdSequence seq where Source
Nothing
OrdSequence ByteString | |
OrdSequence ByteString | |
OrdSequence Text | |
OrdSequence Text | |
Ord a => OrdSequence [a] | |
Ord a => OrdSequence (Seq a) | |
Ord a => OrdSequence (Vector a) | |
(Ord a, Unbox a) => OrdSequence (Vector a) | |
(Ord a, Storable a) => OrdSequence (Vector a) |
class (IsSequence t, IsString t, Element t ~ Char) => Textual t where Source
toCaseFold :: t -> t Source