| Copyright | 2019 Daniel YU |
|---|---|
| License | BSD3 |
| Maintainer | leptonyu@gmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Boots.Internal.Plugin
Description
This module defines a generic application plugin used when booting application.
Documentation
Plugin generates component u with the context of component i running in monad m.
Instances
| MonadReader i (Plugin i m) Source # | |
| MonadTrans (Plugin i) Source # | |
Defined in Boots.Internal.Plugin | |
| Monad (Plugin i m) Source # | |
| Functor (Plugin i m) Source # | |
| Applicative (Plugin i m) Source # | |
Defined in Boots.Internal.Plugin | |
| MonadIO m => MonadIO (Plugin i m) Source # | |
Defined in Boots.Internal.Plugin | |
| MonadThrow m => MonadThrow (Plugin i m) Source # | |
Defined in Boots.Internal.Plugin | |
| Monad m => MonadCont (Plugin i m) Source # | |
Arguments
| :: MonadCatch m | |
| => m u | Open resource. |
| -> (u -> m ()) | Close resource. |
| -> Plugin i m u | Resource plugin. |
Create bracket style plugin, used for manage resources, which need to open and close.
A simple example:
>>>res = bracketP (putStrLn "open") (const $ putStrLn "close")>>>runPlugin () res (const $ putStrLn "using")open using close