Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

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

  1. maybeH :: Monad m => Maybe v -> (v -> m ()) -> Maybe (m ()) -> m ()

    shakespeare Text.Hamlet

    Runs the second argument with the value in the first, if available. Otherwise, runs the third argument, if available.

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

    errors Control.Error

    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
    

  3. maybeT :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m b

    errors Control.Error.Util

    Case analysis for MaybeT Use the first argument if the MaybeT computation fails, otherwise apply the function to the successful result.

  4. maybeEntropy :: MaybeEntropy d => d -> Maybe Double

    statistics Statistics.Distribution

    Returns the entropy of a distribution, in nats, if such is defined.

  5. maybeMean :: MaybeMean d => d -> Maybe Double

    statistics Statistics.Distribution

    No documentation available.

  6. maybeStdDev :: MaybeVariance d => d -> Maybe Double

    statistics Statistics.Distribution

    No documentation available.

  7. maybeVariance :: MaybeVariance d => d -> Maybe Double

    statistics Statistics.Distribution

    No documentation available.

  8. maybeModify :: Storable e => Vector s e -> Int -> (e -> e) -> ST s Bool

    storablevector Data.StorableVector.ST.Strict

    Similar to maybeWrite. In future maybeModify will replace modify.

  9. maybeRead :: Storable e => Vector s e -> Int -> ST s (Maybe e)

    storablevector Data.StorableVector.ST.Strict

    Returns Just e, when the element e could be read and Nothing if the index was out of range. This way you can avoid duplicate index checks that may be needed when using read.

    Control.Monad.ST.runST (do arr <- new_ 10; Monad.zipWithM_ (write arr) [9,8..0] ['a'..]; read arr 3)
    
    In future maybeRead will replace read.

  10. maybeWrite :: Storable e => Vector s e -> Int -> e -> ST s Bool

    storablevector Data.StorableVector.ST.Strict

    Returns True if the element could be written and False if the index was out of range.

    runSTVector (do arr <- new_ 10; foldr (\c go i -> maybeWrite arr i c >>= \cont -> if cont then go (succ i) else return arr) (error "unreachable") ['a'..] 0)
    
    In future maybeWrite will replace write.

Page 38 of many | Previous | Next