MIT licensed by Daniel YU
Maintained by leptonyu@gmail.com

Module documentation for 0.0.100

This version can be pinned in stack with:boots-0.0.100@sha256:31c1e3b500c4830837afa85c1a204101942f2695e9f4aa734fd7d3b79f06d006,1696

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 factory Factory m cxt 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
Depends on 3 packages(full list with versions):
comments powered byDisqus