Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. module Control.Monad.MaybeK

    A continuation-passing variant of Maybe for short-circuiting at failure. This is based largely on code from the Haskell Wiki (http://www.haskell.org/haskellwiki/Performance/Monads) which was released under a simple permissive license (http://www.haskell.org/haskellwiki/HaskellWiki:Copyrights). However, various changes and extensions have been made, which are subject to the BSD license of this package.

  2. data MaybeK a

    unification-fd Control.Monad.MaybeK

    A continuation-passing encoding of Maybe; also known as Codensity Maybe, if you're familiar with that terminology. N.B., this is not the 2-continuation implementation based on the Church encoding of Maybe. The latter tends to have worse performance than non-continuation based implementations. This is generally more efficient than using Maybe for two reasons. First is that it right associates all binds, ensuring that bad associativity doesn't artificially introduce midpoints in short-circuiting to the nearest handler. Second is that it removes the need for intermediate case expressions. N.B., the Alternative and MonadPlus instances are left-biased in a. Thus, they are not commutative.

  3. data MaybeKT (m :: Type -> Type) a

    unification-fd Control.Monad.MaybeK

    A monad transformer version of MaybeK.

  4. type MaybeMaybeManageHook = Query Maybe Maybe Endo WindowSet

    xmonad-contrib XMonad.Hooks.FloatConfigureReq

    A variant of MaybeManageHook that additionally may or may not make changes to the WindowSet.

  5. type MaybeManageHook = Query Maybe Endo WindowSet

    xmonad-contrib XMonad.Hooks.ManageHelpers

    A ManageHook that may or may not have been executed; the outcome is embedded in the Maybe

  6. maybeToList :: Maybe a -> [a]

    base Data.Maybe

    The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.

    Examples

    Basic usage:
    >>> maybeToList (Just 7)
    [7]
    
    >>> maybeToList Nothing
    []
    
    One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:
    >>> import GHC.Internal.Text.Read ( readMaybe )
    
    >>> sum $ maybeToList (readMaybe "3")
    3
    
    >>> sum $ maybeToList (readMaybe "")
    0
    

  7. maybeNew :: (a -> IO (Ptr b)) -> Maybe a -> IO (Ptr b)

    base Foreign.Marshal.Utils

    Allocate storage and marshal a storable value wrapped into a Maybe

  8. maybePeek :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)

    base Foreign.Marshal.Utils

    Convert a peek combinator into a one returning Nothing if applied to a nullPtr

  9. maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO c

    base Foreign.Marshal.Utils

    Converts a withXXX combinator into one marshalling a value wrapped into a Maybe, using nullPtr to represent Nothing.

  10. maybeToExceptT :: forall (m :: Type -> Type) e a . Functor m => e -> MaybeT m a -> ExceptT e m a

    transformers Control.Monad.Trans.Maybe

    Convert a MaybeT computation to ExceptT, with a default exception value.

Page 28 of many | Previous | Next