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. mapMG :: (Vector v a, Vector w b, Dim w ~ Dim v, Monad m) => (a -> m b) -> v a -> m (w b)

    fixed-vector Data.Vector.Fixed.Generic

    Monadic map over vector.

  2. mapServerPartT :: (UnWebT m a -> UnWebT n b) -> ServerPartT m a -> ServerPartT n b

    happstack-server Happstack.Server.Internal.Monads

    Apply a function to transform the inner monad of ServerPartT m. Often used when transforming a monad with ServerPartT, since simpleHTTP requires a ServerPartT IO a. Refer to UnWebT for an explanation of the structure of the monad. Here is an example. Suppose you want to embed an ErrorT into your ServerPartT to enable throwError and catchError in your Monad.

    type MyServerPartT e m a = ServerPartT (ErrorT e m) a
    
    Now suppose you want to pass MyServerPartT into a function that demands a ServerPartT IO a (e.g. simpleHTTP). You can provide the function:
    unpackErrorT :: (Monad m, Show e) => UnWebT (ErrorT e m) a -> UnWebT m a
    unpackErrorT et = do
    eitherV <- runErrorT et
    return $ case eitherV of
    Left err -> Just (Left $ toResponse $
    "Catastrophic failure " ++ show err
    , filterFun $ \r -> r{rsCode = 500})
    Right x -> x
    
    With unpackErrorT you can now call simpleHTTP. Just wrap your ServerPartT list.
    simpleHTTP nullConf $ mapServerPartT unpackErrorT (myPart `catchError` myHandler)
    
    Or alternatively:
    simpleHTTP' unpackErrorT nullConf (myPart `catchError` myHandler)
    
    Also see spUnwrapErrorT for a more sophisticated version of this function.

  3. mapServerPartT' :: (Request -> UnWebT m a -> UnWebT n b) -> ServerPartT m a -> ServerPartT n b

    happstack-server Happstack.Server.Internal.Monads

    A variant of mapServerPartT where the first argument also takes a Request. Useful if you want to runServerPartT on a different ServerPartT inside your monad (see spUnwrapErrorT).

  4. mapWebT :: (UnWebT m a -> UnWebT n b) -> WebT m a -> WebT n b

    happstack-server Happstack.Server.Internal.Monads

    See mapServerPartT for a discussion of this function.

  5. mapServerPartT :: (UnWebT m a -> UnWebT n b) -> ServerPartT m a -> ServerPartT n b

    happstack-server Happstack.Server.Monads

    Apply a function to transform the inner monad of ServerPartT m. Often used when transforming a monad with ServerPartT, since simpleHTTP requires a ServerPartT IO a. Refer to UnWebT for an explanation of the structure of the monad. Here is an example. Suppose you want to embed an ErrorT into your ServerPartT to enable throwError and catchError in your Monad.

    type MyServerPartT e m a = ServerPartT (ErrorT e m) a
    
    Now suppose you want to pass MyServerPartT into a function that demands a ServerPartT IO a (e.g. simpleHTTP). You can provide the function:
    unpackErrorT :: (Monad m, Show e) => UnWebT (ErrorT e m) a -> UnWebT m a
    unpackErrorT et = do
    eitherV <- runErrorT et
    return $ case eitherV of
    Left err -> Just (Left $ toResponse $
    "Catastrophic failure " ++ show err
    , filterFun $ \r -> r{rsCode = 500})
    Right x -> x
    
    With unpackErrorT you can now call simpleHTTP. Just wrap your ServerPartT list.
    simpleHTTP nullConf $ mapServerPartT unpackErrorT (myPart `catchError` myHandler)
    
    Or alternatively:
    simpleHTTP' unpackErrorT nullConf (myPart `catchError` myHandler)
    
    Also see spUnwrapErrorT for a more sophisticated version of this function.

  6. mapServerPartT' :: (Request -> UnWebT m a -> UnWebT n b) -> ServerPartT m a -> ServerPartT n b

    happstack-server Happstack.Server.Monads

    A variant of mapServerPartT where the first argument also takes a Request. Useful if you want to runServerPartT on a different ServerPartT inside your monad (see spUnwrapErrorT).

  7. mapRqData :: (Either (Errors String) a -> Either (Errors String) b) -> RqData a -> RqData b

    happstack-server Happstack.Server.RqData

    transform the result of 'RqData a'. This is similar to fmap except it also allows you to modify the Errors not just a.

  8. mapM :: (Monad m, Ord b) => (a -> m b) -> Heap a -> m (Heap b)

    heaps Data.Heap

    O(n log n). Traverse the elements of the heap in sorted order and produce a new heap using Monadic side-effects.

  9. mapMonotonic :: Ord b => (a -> b) -> Heap a -> Heap b

    heaps Data.Heap

    O(n). Map a monotone increasing function over the heap. Provides a better constant factor for performance than map, but no checking is performed that the function provided is monotone increasing. Misuse of this function can cause a Heap to violate the heap property.

    >>> mapMonotonic (+1) (fromList [1,2,3])
    fromList [2,3,4]
    
    >>> mapMonotonic (*2) (fromList [1,2,3])
    fromList [2,4,6]
    

  10. map' :: Map' f ss => (forall (s :: k) . () => t s -> t' (f s)) -> PL t ss -> PL t' (S' f ss)

    hetero-parameter-list Data.HeteroParList

    No documentation available.

Page 220 of many | Previous | Next