Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. class (Monoid seq, MonoTraversable seq, SemiSequence seq, MonoPointed seq) => IsSequence seq

    mono-traversable Data.Sequences

    Sequence Laws:

    fromList . otoList = id
    fromList (x <> y) = fromList x <> fromList y
    otoList (fromList x <> fromList y) = x <> y
    

  2. class (IsSequence lazy, IsSequence strict) => LazySequence lazy strict | lazy -> strict, strict -> lazy

    mono-traversable Data.Sequences

    Lazy sequences containing strict chunks of data.

  3. class (Integral Index seq, GrowingAppend seq) => SemiSequence seq

    mono-traversable Data.Sequences

    SemiSequence was created to share code between IsSequence and NonNull. Semi means SemiGroup A SemiSequence can accommodate a SemiGroup such as NonEmpty or NonNull A Monoid should be able to fill out IsSequence. SemiSequence operations maintain the same type because they all maintain the same number of elements or increase them. However, a decreasing function such as filter may change they type. For example, from NonEmpty to '[]' This type-changing function exists on NonNull as nfilter filter and other such functions are placed in IsSequence NOTE: Like GrowingAppend, ideally we'd have a Semigroup superclass constraint here, but that would pull in more dependencies to this package than desired.

  4. subsequences :: IsSequence seq => seq -> [seq]

    mono-traversable Data.Sequences

    subsequences returns a list of all subsequences of the argument.

    > subsequences "abc"
    ["","a","b","ab","c","ac","bc","abc"]
    

  5. isSubsequenceOf :: Eq a => [a] -> [a] -> Bool

    rio RIO.List

    The isSubsequenceOf function takes two lists and returns True if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively. isSubsequenceOf x y is equivalent to x `elem` (subsequences y). Note: isSubsequenceOf is often used in infix form.

    Examples

    >>> "GHC" `isSubsequenceOf` "The Glorious Haskell Compiler"
    True
    
    >>> ['a','d'..'z'] `isSubsequenceOf` ['a'..'z']
    True
    
    >>> [1..10] `isSubsequenceOf` [10,9..0]
    False
    
    For the result to be True, the first list must be finite; for the result to be False, the second list must be finite:
    >>> [0,2..10] `isSubsequenceOf` [0..]
    True
    
    >>> [0..] `isSubsequenceOf` [0,2..10]
    False
    
    >>> [0,2..] `isSubsequenceOf` [0..]
    * Hangs forever*
    

  6. subsequences :: [a] -> [[a]]

    rio RIO.List

    The subsequences function returns the list of all subsequences of the argument.

    Laziness

    subsequences does not look ahead unless it must:
    >>> take 1 (subsequences undefined)
    [[]]
    
    >>> take 2 (subsequences ('a' : undefined))
    ["","a"]
    

    Examples

    >>> subsequences "abc"
    ["","a","b","ab","c","ac","bc","abc"]
    
    This function is productive on infinite inputs:
    >>> take 8 $ subsequences ['a'..]
    ["","a","b","ab","c","ac","bc","abc"]
    

  7. bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b)

    rio RIO.Prelude

    Sequences all the actions in a structure, building a new structure with the same shape using the results of the actions. For a version that ignores the results, see bisequence_.

    bisequencebitraverse id id
    

    Examples

    Basic usage:
    >>> bisequence (Just 4, Nothing)
    Nothing
    
    >>> bisequence (Just 4, Just 5)
    Just (4,5)
    
    >>> bisequence ([1, 2, 3], [4, 5])
    [(1,4),(1,5),(2,4),(2,5),(3,4),(3,5)]
    

  8. bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f ()

    rio RIO.Prelude

    Evaluate each action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results, see bisequence.

    Examples

    Basic usage:
    >>> bisequence_ (print "Hello", print "World")
    "Hello"
    "World"
    
    >>> bisequence_ (Left (print "Hello"))
    "Hello"
    
    >>> bisequence_ (Right (print "World"))
    "World"
    

  9. enumSequenceFrom :: Num a => a -> Sequence a

    math-functions Numeric.Series

    enumSequenceFrom x generate sequence: <math>

  10. enumSequenceFromStep :: Num a => a -> a -> Sequence a

    math-functions Numeric.Series

    enumSequenceFromStep x d generate sequence: <math>

Page 53 of many | Previous | Next