packages feed

magicbane 0.1.1 → 0.1.2

raw patch · 2 files changed

+88/−80 lines, 2 filesdep ~basedep ~servantdep ~servant-server

Dependency ranges changed: base, servant, servant-server

Files

library/Magicbane/App.hs view
@@ -9,7 +9,7 @@ , module Magicbane.App ) where -import           ClassyPrelude+import           ClassyPrelude hiding (Handler) import           Control.Monad.Trans.Except as X import           Control.Monad.Except as X (MonadError, throwError) import           Data.Proxy as X@@ -17,28 +17,28 @@ import           Servant as X hiding (And)  newtype MagicbaneApp β α = MagicbaneApp {-  unMagicbaneApp ∷ ReaderT β (ExceptT ServantErr IO) α+  unMagicbaneApp ∷ ReaderT β Handler α } deriving (Functor, Applicative, Monad, MonadIO, MonadBase IO,             MonadThrow, MonadCatch, MonadError ServantErr, MonadReader β)  instance MonadBaseControl IO (MagicbaneApp β) where-  type StM (MagicbaneApp β) α = StM (ReaderT β (ExceptT ServantErr IO)) α+  type StM (MagicbaneApp β) α = StM (ReaderT β Handler) α   liftBaseWith f = MagicbaneApp $ liftBaseWith $ \x → f $ x . unMagicbaneApp   restoreM       = MagicbaneApp . restoreM -runMagicbaneExcept ∷ β → MagicbaneApp β α → ExceptT ServantErr IO α-runMagicbaneExcept ctx a = ExceptT $ liftIO $ runExceptT $ runReaderT (unMagicbaneApp a) ctx+runMagicbaneHandler ∷ β → MagicbaneApp β α → Handler α+runMagicbaneHandler ctx a = Handler $ ExceptT $ liftIO $ runHandler $ runReaderT (unMagicbaneApp a) ctx -magicbaneToExcept ∷ β → MagicbaneApp β :~> ExceptT ServantErr IO+magicbaneToHandler ∷ β → MagicbaneApp β :~> Handler #if MIN_VERSION_servant_server(0,10,0)-magicbaneToExcept ctx = NT $ runMagicbaneExcept ctx+magicbaneToHandler ctx = NT $ runMagicbaneHandler ctx #else-magicbaneToExcept ctx = Nat $ runMagicbaneExcept ctx+magicbaneToHandler ctx = Nat $ runMagicbaneHandler ctx #endif  -- | Constructs a WAI application from an API definition, a Servant context (used for auth mainly), the app context and the actual action handlers. magicbaneApp api sctx ctx actions = serveWithContext api sctx $ srv ctx-  where srv c = enter (magicbaneToExcept c) actions+  where srv c = enter (magicbaneToHandler c) actions  -- | Gets a value of any type from the context. askObj ∷ (Has β α, MonadReader α μ) ⇒ μ β
magicbane.cabal view
@@ -1,75 +1,83 @@-name:            magicbane-version:         0.1.1-synopsis:        A web framework that integrates Servant, ClassyPrelude, EKG, fast-logger, wai-cli…-description:     Inspired by Dropwizard, Magicbane provides a packaged framework for developing web services using the best available libraries, including Servant, ClassyPrelude, Aeson, EKG/monad-metrics, fast-logger/monad-logger, wai-cli and others.-category:        Web-homepage:        https://github.com/myfreeweb/magicbane-author:          Greg V-copyright:       2017 Greg V <greg@unrelenting.technology>-maintainer:      greg@unrelenting.technology-license:         PublicDomain-build-type:      Simple-cabal-version:   >= 1.10-tested-with:-    GHC == 8.0.2+-- This file has been generated from package.yaml by hpack version 0.18.1.+--+-- see: https://github.com/sol/hpack +name:           magicbane+version:        0.1.2+synopsis:       A web framework that integrates Servant, ClassyPrelude, EKG, fast-logger, wai-cli…++description:    Inspired by Dropwizard, Magicbane provides a packaged framework for developing web services using the best available libraries, including Servant, ClassyPrelude, Aeson, EKG/monad-metrics, fast-logger/monad-logger, wai-cli and others.+category:       Web+homepage:       https://github.com/myfreeweb/magicbane#readme+bug-reports:    https://github.com/myfreeweb/magicbane/issues+author:         Greg V+maintainer:     greg@unrelenting.technology+copyright:      2017 Greg V <greg@unrelenting.technology>+license:        PublicDomain+tested-with:    GHC==8.0.2+build-type:     Simple+cabal-version:  >= 1.10+ source-repository head-    type: git-    location: git://github.com/myfreeweb/magicbane.git+  type: git+  location: https://github.com/myfreeweb/magicbane  library-    build-depends:-        base >= 4.8.0.0 && < 5-      , classy-prelude-      , transformers-      , errors-      , split-      , either-      , mtl-      , refined-      , lifted-async-      , monad-control-      , monad-metrics-      , monad-logger-      , fast-logger-      , ekg-core-      , ekg-wai-      , data-default-      , data-has-      , string-conversions-      , unordered-containers-      , attoparsec-      , text-      , conduit-      , conduit-combinators-      , aeson-      , aeson-qq-      , raw-strings-qq-      , wai-      , wai-middleware-metrics-      , wai-cli-      , servant-      , servant-server-      , network-uri-      , network-      , http-types-      , http-media-      , http-client-      , http-client-tls-      , http-conduit-      , http-link-header-      , http-date-      , http-api-data-      , mime-types-      , envy-    default-language: Haskell2010-    exposed-modules:-        Magicbane-        Magicbane.App-        Magicbane.Logging-        Magicbane.Metrics-        Magicbane.Validation-        Magicbane.HTTPClient-        Magicbane.Util-    ghc-options: -Wall-    hs-source-dirs: library+  hs-source-dirs:+      library+  ghc-options: -Wall+  build-depends:+      base >=4.8.0.0 && <5+    , classy-prelude+    , transformers+    , errors+    , split+    , either+    , mtl+    , refined+    , lifted-async+    , monad-control+    , monad-metrics+    , monad-logger+    , fast-logger+    , ekg-core+    , ekg-wai+    , data-default+    , data-has+    , string-conversions+    , unordered-containers+    , attoparsec+    , text+    , conduit+    , conduit-combinators+    , aeson+    , aeson-qq+    , raw-strings-qq+    , wai+    , wai-middleware-metrics+    , wai-cli+    , servant+    , servant-server+    , network-uri+    , network+    , http-types+    , http-media+    , http-client+    , http-client-tls+    , http-conduit+    , http-link-header+    , http-date+    , http-api-data+    , mime-types+    , envy+  exposed-modules:+      Magicbane+      Magicbane.App+      Magicbane.Logging+      Magicbane.Metrics+      Magicbane.Validation+      Magicbane.HTTPClient+      Magicbane.Util+  other-modules:+      Paths_magicbane+  default-language: Haskell2010