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.

  1. 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

  2. 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.

  3. SqliteStatusMallocCount :: SqliteStatusVerb

    persistent-sqlite Database.Sqlite

    This parameter records the number of separate memory allocations currently checked out.

  4. SqliteStatusMallocSize :: SqliteStatusVerb

    persistent-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.

  5. data CallStack

    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:
    1. 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.
    2. 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).
    3. 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.
    CallStacks do not interact with the RTS and do not require compilation with -prof. On the other hand, as they are built up explicitly via the HasCallStack constraints, they will generally not contain as much information as the simulated call-stacks maintained by the RTS. A CallStack is a [(String, SrcLoc)]. The String is the name of function that was called, the SrcLoc is the call-site. The list is ordered with the most recently called function at the head. NOTE: The intrepid user may notice that HasCallStack is just an alias for an implicit parameter ?callStack :: CallStack. This is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

  6. displayCallStack :: CallStack -> Utf8Builder

    rio RIO

    Convert a CallStack value into a Utf8Builder indicating the first source location. TODO Consider showing the entire call stack instead.

  7. 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

  8. groupAllWith1 :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)

    rio RIO.NonEmpty

    groupAllWith1 is to groupWith1 as groupAllWith is to groupWith

  9. biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool

    rio 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
    

  10. 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
    Examples:
    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.

Page 411 of many | Previous | Next