Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
groupAll :: (IsSequence seq, Eq (Element seq)) => seq -> [seq]mono-traversable Data.Sequences Similar to standard group, but operates on the whole collection, not just the consecutive items. Equivalent to groupAllOn id
groupAllOn :: (IsSequence seq, Eq b) => (Element seq -> b) -> seq -> [seq]mono-traversable Data.Sequences Similar to standard groupBy, but operates on the whole collection, not just the consecutive items.
SqliteStatusMallocCount :: SqliteStatusVerbpersistent-sqlite Database.Sqlite This parameter records the number of separate memory allocations currently checked out.
SqliteStatusMallocSize :: SqliteStatusVerbpersistent-sqlite Database.Sqlite This parameter records the largest memory allocation request handed to sqlite3_malloc() or sqlite3_realloc() (or their internal equivalents). Only the value returned in sqliteStatusHighwater field of SqliteStatus record is of interest. The value written into the sqliteStatusCurrent field is Nothing.
-
rio RIO CallStacks are a lightweight method of obtaining a partial call-stack at any point in the program. A function can request its call-site with the HasCallStack constraint. For example, we can define
putStrLnWithCallStack :: HasCallStack => String -> IO ()
as a variant of putStrLn that will get its call-site and print it, along with the string given as argument. We can access the call-stack inside putStrLnWithCallStack with callStack.>>> :{ putStrLnWithCallStack :: HasCallStack => String -> IO () putStrLnWithCallStack msg = do putStrLn msg putStrLn (prettyCallStack callStack) :}Thus, if we call putStrLnWithCallStack we will get a formatted call-stack alongside our string.>>> putStrLnWithCallStack "hello" hello CallStack (from HasCallStack): putStrLnWithCallStack, called at <interactive>:... in interactive:Ghci...
GHC solves HasCallStack constraints in three steps:- If there is a CallStack in scope -- i.e. the enclosing function has a HasCallStack constraint -- GHC will append the new call-site to the existing CallStack.
- If there is no CallStack in scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer a HasCallStack constraint for the enclosing definition (subject to the monomorphism restriction).
- If there is no CallStack in scope and the enclosing definition has an explicit type signature, GHC will solve the HasCallStack constraint for the singleton CallStack containing just the current call-site.
displayCallStack :: CallStack -> Utf8Builderrio RIO Convert a CallStack value into a Utf8Builder indicating the first source location. TODO Consider showing the entire call stack instead.
groupAllWith :: Ord b => (a -> b) -> [a] -> [NonEmpty a]rio RIO.NonEmpty groupAllWith operates like groupWith, but sorts the list first so that each equivalence class has, at most, one list in the output
groupAllWith1 :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)rio RIO.NonEmpty groupAllWith1 is to groupWith1 as groupAllWith is to groupWith
biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Boolrio RIO.Prelude Determines whether all elements of the structure satisfy their appropriate predicate argument. Empty structures yield True.
Examples
Basic usage:>>> biall even isDigit (27, 't') False
>>> biall even isDigit (26, '8') True
>>> biall even isDigit (Left 27) False
>>> biall even isDigit (Left 26) True
>>> biall even isDigit (BiList [26, 52] ['3', '8']) True
Empty structures yield True:>>> biall even isDigit (BiList [] []) True
breakOnAll :: HasCallStack => Text -> Text -> [(Text, Text)]rio RIO.Text.Lazy.Partial O(n+m) Find all non-overlapping instances of needle in haystack. Each element of the returned list consists of a pair:
- The entire string prior to the kth match (i.e. the prefix)
- The kth match, followed by the remainder of the string
breakOnAll "::" "" ==> [] breakOnAll "/" "a/b/c/" ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]This function is strict in its first argument, and lazy in its second. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m). The needle parameter may not be empty.