Hoogle Search
Within LTS Haskell 24.35 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
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
shorterList :: [a] -> [a] -> [a]utility-ht Data.List.Match Returns the shorter one of two lists. It works also for infinite lists as much as possible. E.g.
>>> shorterList (shorterList (repeat 'a') (repeat 'b')) "abc" "abc"
The trick is, that the skeleton of the resulting list is constructed using zipWith without touching the elements. The contents is then computed (only) if requested.embedDirListing :: FilePath -> Q Expfile-embed Data.FileEmbed Embed a directory listing recursively in your source code.
myFiles :: [FilePath] myFiles = $(embedDirListing "dirName")
parseJSONList :: FromJSON a => Value -> Parser [a]yaml Data.Yaml No documentation available.
toEncodingList :: ToJSON a => [a] -> Encodingyaml Data.Yaml No documentation available.