boots: Boot application by plugins

[ application, factory, ioc, library, mit, monad ] [ Propose Tags ]

Boot application by using plugins.


[Skip to Readme]
Versions [RSS] [faq] 0, 0.0.1, 0.0.2, 0.0.3, 0.0.100, 0.1, 0.1.1, 0.2, 0.2.0.1 (info)
Dependencies base (>=4.10 && <5), boots, data-default (>=0.7.1.1 && <0.8), exceptions (>=0.10.2 && <0.11), fast-logger (>=2.4.16 && <2.5), microlens (>=0.4.10 && <0.5), monad-logger (>=0.3.30 && <0.4), mtl (>=2.2.2 && <2.3), salak (==0.3.1), salak-yaml (==0.3.1), text (>=1.2.3.1 && <1.3), unliftio-core (>=0.1.2.0 && <0.2) [details]
License MIT
Copyright 2019 Daniel YU
Author Daniel YU
Maintainer leptonyu@gmail.com
Revised Revision 1 made by leptonyu at 2019-09-05T02:56:34Z
Category Library
Home page https://github.com/leptonyu/boots#readme
Uploaded by leptonyu at 2019-07-28T03:01:48Z
Distributions LTSHaskell:0.2.0.1, NixOS:0.2.0.1, Stackage:0.2.0.1
Executables boots-exe
Downloads 2007 total (33 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for boots-0.0.2

[back to package description]

boots

Hackage stackage LTS package stackage Nightly package Build Status

Boot applications by using plugins.

Motivation

Simplify to create an application in Haskell.

When we decide to create an application using Haskell. We may need using configurations, loggers as basic functions. If this application needs storages, caches, etc., then we have to weaving the management of connection of these facilities into the application. Connections need to be created before and be destroyed after using them. There is a common strategy to manage connections, that is using Control.Monad.Cont. Then we can encapsulate the management of connections separately. For example, we can write a database plugin Plugin cxt m DBConnection, which can manage the database connections in monad m with context cxt. Context cxt may be requested for configurations or logging functions. When all the components of application are encapsulated by plugins, then building an application will be simplified.

Have a Try

main :: IO ()
main = bootApp (pluginSimple "application") go
  where
    go = forever $ do
      user <- require "user"              -- Request for configuration.
      logInfo $ "Hello, " <> user <> "!"  -- Request for logging.
      liftIO $ threadDelay 1000000