Hoogle Search

Within LTS Haskell 24.41 (ghc-9.10.3)

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

  1. imapMaybe :: FilterableWithIndex i t => (i -> a -> Maybe b) -> t a -> t b

    witherable Witherable

    No documentation available.

  2. gmapM :: (Data a, Monad m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Compat.Base

    A generic monadic transformation that maps over the immediate subterms The default definition instantiates the type constructor c in the type of gfoldl to the monad datatype constructor, defining injection and projection using return and >>=.

  3. gmapMo :: (Data a, MonadPlus m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Compat.Base

    Transformation of one immediate subterm with success

  4. gmapMp :: (Data a, MonadPlus m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Compat.Base

    Transformation of at least one immediate subterm does not fail

  5. gmapM :: (Data a, Monad m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Imports

    A generic monadic transformation that maps over the immediate subterms The default definition instantiates the type constructor c in the type of gfoldl to the monad datatype constructor, defining injection and projection using return and >>=.

  6. gmapMo :: (Data a, MonadPlus m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Imports

    Transformation of one immediate subterm with success

  7. gmapMp :: (Data a, MonadPlus m) => (forall d . Data d => d -> m d) -> a -> m a

    basement Basement.Imports

    Transformation of at least one immediate subterm does not fail

  8. cmapM :: Monad m => (a -> m b) -> LogAction m b -> LogAction m a

    co-log-core Colog.Core.Action

    cmapM combinator is similar to cmap but allows to call monadic functions (functions that require extra context) to extend consumed value. Consider the following example. You have this logging record:

    data LogRecord = LR
    { lrTime    :: UTCTime
    , lrMessage :: Text
    }
    
    and you also have logging consumer inside IO for such record:
    logRecordAction :: LogAction IO LogRecord
    
    But you need to return consumer only for Text messages:
    logTextAction :: LogAction IO Text
    
    If you have function that can extend Text to LogRecord like the function below:
    withTime :: Text -> IO LogRecord
    withTime msg = do
    time <- getCurrentTime
    pure (LR time msg)
    
    you can achieve desired behavior with cmapM in the following way:
    logTextAction :: LogAction IO Text
    logTextAction = cmapM withTime myAction
    

  9. cmapMaybe :: forall (m :: Type -> Type) a b . Applicative m => (a -> Maybe b) -> LogAction m b -> LogAction m a

    co-log-core Colog.Core.Action

    cmap for convertions that may fail

  10. cmapMaybeM :: Monad m => (a -> m (Maybe b)) -> LogAction m b -> LogAction m a

    co-log-core Colog.Core.Action

    Similar to cmapMaybe but for convertions that may fail inside a monadic context.

Page 75 of many | Previous | Next