Hoogle Search

Within LTS Haskell 24.64 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. justThis :: These a b -> Maybe a

    these Data.These.Combinators

    No documentation available.

  2. justifyLeft :: Int -> Char -> Text -> Text

    rio RIO.Text

    O(n) Left-justify a string to the given length, using the specified fill character on the right. Performs replacement on invalid scalar values. Examples:

    >>> justifyLeft 7 'x' "foo"
    "fooxxxx"
    
    >>> justifyLeft 3 'x' "foobar"
    "foobar"
    

  3. justifyRight :: Int -> Char -> Text -> Text

    rio RIO.Text

    O(n) Right-justify a string to the given length, using the specified fill character on the left. Performs replacement on invalid scalar values. Examples:

    >>> justifyRight 7 'x' "bar"
    "xxxxbar"
    
    >>> justifyRight 3 'x' "foobar"
    "foobar"
    

  4. justifyLeft :: Int64 -> Char -> Text -> Text

    rio RIO.Text.Lazy

    O(n) Left-justify a string to the given length, using the specified fill character on the right. Performs replacement on invalid scalar values. Examples:

    justifyLeft 7 'x' "foo"    == "fooxxxx"
    justifyLeft 3 'x' "foobar" == "foobar"
    

  5. justifyRight :: Int64 -> Char -> Text -> Text

    rio RIO.Text.Lazy

    O(n) Right-justify a string to the given length, using the specified fill character on the left. Performs replacement on invalid scalar values. Examples:

    justifyRight 7 'x' "bar"    == "xxxxbar"
    justifyRight 3 'x' "foobar" == "foobar"
    

  6. justVarInterpolation :: ShakespeareSettings -> Bool

    shakespeare Text.Shakespeare

    No documentation available.

  7. justErr :: e -> Maybe a -> Either e a

    errors Control.Error.Safe

    A fromJust that fails in the Either monad

  8. justZ :: MonadPlus m => Maybe a -> m a

    errors Control.Error.Safe

    A fromJust that fails using mzero

  9. justifyLeft :: Word -> Char -> Buffer % 1 -> Buffer

    text-builder-linear Data.Text.Builder.Linear.Buffer

    Pad a builder from the right side to the specified length with the specified character.

    >>> :set -XLinearTypes
    
    >>> runBuffer (\b -> justifyLeft 10 'x' (appendChars 3 'A' b))
    "AAAxxxxxxx"
    
    >>> runBuffer (\b -> justifyLeft 5 'x' (appendChars 6 'A' b))
    "AAAAAA"
    
    Note that newEmptyBuffer is needed in some situations. See justifyRight for an example. Warning: In contrast to singleton, it is the responsibility of the caller to sanitize surrogate code points with safe.

  10. justifyRight :: Word -> Char -> Buffer % 1 -> Buffer

    text-builder-linear Data.Text.Builder.Linear.Buffer

    Pad a builder from the left side to the specified length with the specified character.

    >>> :set -XLinearTypes
    
    >>> runBuffer (\b -> justifyRight 10 'x' (appendChars 3 'A' b))
    "xxxxxxxAAA"
    
    >>> runBuffer (\b -> justifyRight 5 'x' (appendChars 6 'A' b))
    "AAAAAA"
    
    Note that newEmptyBuffer is needed in some situations. The following example creates a utility function that justify a text and then append it to a buffer.
    >>> :set -XOverloadedStrings -XLinearTypes -XUnboxedTuples
    
    >>> import Data.Text.Builder.Linear.Buffer
    
    >>> import Data.Text (Text)
    
    >>> :{
    appendJustified :: Buffer %1 -> Text -> Buffer
    appendJustified b t = case newEmptyBuffer b of
    -- Note that we need to create a new buffer from the text, in order
    -- to justify only the text and not the input buffer.
    (# b', empty #) -> b' >< justifyRight 12 ' ' (empty |> t)
    :}
    
    >>> runBuffer (\b -> (b |> "Test:") `appendJustified` "AAA" `appendJustified` "BBBBBBB")
    "Test:         AAA     BBBBBBB"
    
    Warning: In contrast to singleton, it is the responsibility of the caller to sanitize surrogate code points with safe.

Page 16 of many | Previous | Next