boots: IoC Monad in Haskell

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

Inverse of control monad used in building large application.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 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), exceptions (>=0.10.2 && <0.11), mtl (>=2.2.2 && <2.3) [details]
License MIT
Copyright 2019 Daniel YU
Author Daniel YU
Maintainer leptonyu@gmail.com
Category Library, Application
Home page https://github.com/leptonyu/boots#readme
Uploaded by leptonyu at 2019-08-05T06:30:47Z
Distributions
Reverse Dependencies 3 direct, 0 indirect [details]
Downloads 2948 total (25 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-08-05 [all 1 reports]

Readme for boots-0.1

[back to package description]

boots

Hackage Build stackage LTS package stackage Nightly package MIT license

IoC Monad in Haskell.

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.

A Project Use boots to Build

Refer to 鬼谷子

Have a Try

factory = do
  log  <-  logFactory
  conf <- confFactory
  within (log, conf) $ do
    a <- withFactory fst aFactory
    b <- withFactory snd bFactory
    polish AB{..}
      [ xFactory
      , yFactory
      ] >>> bootFactory