Hoogle Search

Within LTS Haskell 24.49 (ghc-9.10.3)

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

  1. forever :: Applicative f => f a -> f b

    basic-prelude BasicPrelude

    Repeat an action indefinitely.

    Examples

    A common use of forever is to process input from network sockets, Handles, and channels (e.g. MVar and Chan). For example, here is how we might implement an echo server, using forever both to listen for client connections on a network socket and to echo client input on client connection handles:
    echoServer :: Socket -> IO ()
    echoServer socket = forever $ do
    client <- accept socket
    forkFinally (echo client) (\_ -> hClose client)
    where
    echo :: Handle -> IO ()
    echo client = forever $
    hGetLine client >>= hPutStrLn client
    
    Note that "forever" isn't necessarily non-terminating. If the action is in a MonadPlus and short-circuits after some number of iterations. then forever actually returns mzero, effectively short-circuiting its caller.

  2. forceAttrMap :: Attr -> AttrMap

    brick Brick.AttrMap

    Create an attribute map in which all lookups map to the same attribute. This is functionally equivalent to attrMap attr [].

  3. forceAttrMapAllowStyle :: Attr -> AttrMap -> AttrMap

    brick Brick.AttrMap

    Create an attribute map in which all lookups map to the same attribute. This is functionally equivalent to attrMap attr [].

  4. formAttr :: AttrName

    brick Brick.Forms

    The namespace for the other form attributes.

  5. formFieldExternallyValid :: FormField a b e n -> Bool

    brick Brick.Forms

    Whether the field is valid according to an external validation source. Defaults to always being True and can be set with setFieldValid. The value of this field also affects the behavior of allFieldsValid and getInvalidFields.

  6. formFieldHandleEvent :: FormField a b e n -> BrickEvent n e -> EventM n b ()

    brick Brick.Forms

    An event handler for this field.

  7. formFieldName :: FormField a b e n -> n

    brick Brick.Forms

    The name identifying this form field.

  8. formFieldRender :: FormField a b e n -> Bool -> b -> Widget n

    brick Brick.Forms

    A function to render this form field. Parameters are whether the field is currently focused, followed by the field state.

  9. formFieldValidate :: FormField a b e n -> b -> Maybe a

    brick Brick.Forms

    A validation function converting this field's state into a value of your choosing. Nothing indicates a validation failure. For example, this might validate an Editor state value by parsing its text contents as an integer and return Maybe Int. This is for pure value validation; if additional validation is required (e.g. via IO), use this field's state value in an external validation routine and use setFieldValid to feed the result back into the form.

  10. formFocus :: Form s e n -> FocusRing n

    brick Brick.Forms

    The focus ring for the form, indicating which form field has input focus.

Page 70 of many | Previous | Next