Hoogle Search
Within LTS Haskell 24.19 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
isSubsequenceOf :: Eq a => [a] -> [a] -> Boolghc-internal GHC.Internal.Data.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*
-
ghc-internal GHC.Internal.Data.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"]
-
ghc-internal GHC.Internal.Data.OldList 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"]
InvalidSequence :: CodingProgressghc-internal GHC.Internal.IO.Encoding Stopped because there are sufficient free elements in the output to output at least one encoded ASCII character, but the input contains an invalid or unrepresentable sequence
InvalidSequence :: CodingProgressghc-internal GHC.Internal.IO.Encoding.Types Stopped because there are sufficient free elements in the output to output at least one encoded ASCII character, but the input contains an invalid or unrepresentable sequence
-
protolude Protolude 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"]
subsequences :: Infinite a -> Infinite [a]infinite-list Data.List.Infinite Generate an infinite list of all finite subsequences of the argument.
>>> take 8 (subsequences (0...)) [[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]]
subsequences1 :: Infinite a -> Infinite (NonEmpty a)infinite-list Data.List.Infinite Generate an infinite list of all non-empty finite subsequences of the argument.
>>> take 7 (subsequences1 (0...)) [0 :| [],1 :| [],0 :| [1],2 :| [],0 :| [2],1 :| [2],0 :| [1,2]]
ySequence :: Loader (m :: Type -> Type) n -> Tag -> [n] -> LoaderT m nHsYAML Data.YAML No documentation available.
schemaEncoderSequence :: SchemaEncoder -> Tag -> Either String TagHsYAML Data.YAML.Schema No documentation available.