Hoogle Search
Within LTS Haskell 24.28 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
onSublist :: Eq a => [a] -> Splitter asplit Data.List.Split.Internals A splitting strategy that splits on the given list, when it is encountered as an exact subsequence.
>>> split (onSublist "xyz") "aazbxyzcxd" ["aazb","xyz","cxd"]
Note that splitting on the empty list is a special case, which splits just before every element of the list being split.>>> split (onSublist "") "abc" ["","","a","","b","","c"]
>>> split (dropDelims . dropBlanks $ onSublist "") "abc" ["a","b","c"]
However, if you want to break a list into singleton elements like this, you are better off using chunksOf 1, or better yet, map (:[]).fillList :: Storable storable => [storable] -> Packer ()memory Data.ByteArray.Pack Will put the given storable list from the current position in the stream to the end. This function will fail with not enough storage if the given storable can't be written (not enough space) Example:
> pack (fillList $ [1..] :: Word8) 9 "\1\2\3\4\5\6\7\8\9" > pack (fillList $ [1..] :: Word32) 4 "\1\0\0\0" > pack (fillList $ [1..] :: Word32) 64 .. <..succesful..> > pack (fillList $ [1..] :: Word32) 1 .. <.. not enough space ..> > pack (fillList $ [1..] :: Word32) 131 .. <.. not enough space ..>
-
A difference list is an abstraction representing a list that supports <math>(1) append and snoc operations. This module provides the type for a difference list, DList, and a collection of supporting functions for (a) converting to and from lists and (b) operating on DLists efficiently.
-
dlist Data.DList A difference list is an abstraction representing a list that supports <math>(1) append and snoc operations, making it useful for replacing frequent applications of ++ such as logging and pretty printing (esp. if those uses of ++ are left-nested).
-
dlist Data.DList fromList xs is a DList representing the list xs. fromList obeys the laws:
toList . fromList = id fromList . toList = id
This function is implemented with ++. Repeated uses of fromList are just as inefficient as repeated uses of ++. If you find yourself doing some form of the following (possibly indirectly), you may not be taking advantage of the DList representation and library:fromList . f . toList
More likely, you will convert from a list, perform some operation on the DList, and convert back to a list:toList . g . fromList
-
dlist Data.DList toList xs is the list represented by xs. toList obeys the laws:
toList . fromList = id fromList . toList = id
Evaluating toList xs may “collapse” the chain of function composition underlying many DList functions (append in particular) used to construct xs. This may affect any efficiency you achieved due to laziness in the construction. fromList :: [a] -> DNonEmpty adlist Data.DList.DNonEmpty fromList xs is a DNonEmpty representing the list xs. If xs is empty, an error is raised. fromList obeys the law:
fromList xs = fromNonEmpty (fromList xs)
-
dlist Data.DList.DNonEmpty toList xs is the non-empty list represented by xs. toList obeys the law:
toList xs = toList (toNonEmpty xs)
decorateList :: [a] -> (a -> Validation) -> Validationvalidity Data.Validity Decorate a piecewise validation of a list with their location in the list
appendList :: NonEmpty a -> [a] -> NonEmpty abase-compat Data.List.NonEmpty.Compat Attach a list at the end of a NonEmpty.
>>> appendList (1 :| [2,3]) [] 1 :| [2,3]
>>> appendList (1 :| [2,3]) [4,5] 1 :| [2,3,4,5]