airship 0.9.4 → 0.9.5
raw patch · 5 files changed
+107/−103 lines, 5 filesdep ~base64-bytestringdep ~bytestring-triedep ~mmorphsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base64-bytestring, bytestring-trie, mmorph, semigroups, text, wai, wai-extra
API changes (from Hackage documentation)
Files
- Changes.md +5/−0
- README.md +9/−5
- Setup.hs +0/−2
- airship.cabal +92/−84
- src/Airship/RST.hs +1/−12
Changes.md view
@@ -1,8 +1,13 @@+* 0.9.5 + - Maintenance release bumps upper bounds and add support for GHC 9.2.2.+ * 0.9.4 - Bump upper bounds on bytestring-trie - Support GHC 8.4 and 8.6+ * 0.9.3 - Bump upper bound on http-types due to stackage.+ * 0.9.0 - Handle unspecified content-type (#107) - Unroll internal webmachine monad (#108)
README.md view
@@ -1,8 +1,6 @@ # Airship -[](https://gitter.im/helium/airship?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)--[](https://travis-ci.org/helium/airship)+[![GitHub CI][github-shield]][github-ci] [![docs][docs-shield]][docs] Airship is a Haskell library for handling and serving HTTP requests in a RESTful fashion. It is heavily inspired by [Webmachine](https://github.com/basho/webmachine) and works with any [WAI](https://hackage.haskell.org/package/wai)-compatible web server such as [Warp](https://hackage.haskell.org/package/warp).@@ -11,7 +9,7 @@ # How does it work? -Airship resources are represented with a [`Resource` record type](https://github.com/helium/airship/blob/master/airship/src/Airship/Resource.hs#L39-L117).+Airship resources are represented with a [`Resource` record type](https://github.com/tmcgilchrist/airship/blob/master/airship/src/Airship/Resource.hs#L39-L117). Each field in `Resource` corresponds to an action taken in the [Webmachine decision tree](https://raw.githubusercontent.com/wiki/Webmachine/webmachine/images/http-headers-status-v3.png). Airship provides a `defaultResource` with sensible defaults for each of these actions; you build web services by overriding fields in the default resource with your own. @@ -23,7 +21,13 @@ "account" </> var "name" #> accountResource ``` -For a simple example that handles HTTP GET and POST requests, please check [`example/Basic.hs`](https://github.com/helium/airship/blob/master/example/Basic.hs).+For a simple example that handles HTTP GET and POST requests, please check [`example/Basic.hs`](https://github.com/tmcgilchrist/airship/blob/master/example/Basic.hs). For a slightly more involved example that generates HTML and manages a pool of resources, please check the [blimp](https://github.com/patrickt/blimp) repository. Airship is copyright © 2015 Helium Systems, Inc., and released to the public under the terms of the MIT license.++[github-shield]: https://github.com/tmcgilchrist/airship/actions/workflows/ci.yaml/badge.svg+[github-ci]: https://github.com/tmcgilchrist/airship/actions/workflows/ci.yaml++[docs-shield]:https://img.shields.io/badge/doc-online-blue.svg+[docs]: https://tmcgilchrist.github.io/airship/index.html
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
airship.cabal view
@@ -1,95 +1,103 @@-name: airship-synopsis: A Webmachine-inspired HTTP library-homepage: https://github.com/helium/airship/-Bug-reports: https://github.com/helium/airship/issues-version: 0.9.4-license: MIT-license-file: LICENSE-author: Reid Draper and Patrick Thomson-maintainer: Tim McGilchrist <timmcgil@gmail.com>-category: Web-build-type: Simple-cabal-version: >=1.10-description: A Webmachine-inspired HTTP library based off ideas from the original Erlang project <https://github.com/webmachine/webmachine>- .- A number of examples can be found in <https://github.com/helium/airship/tree/master/example> illustrating how to build airship based services.-tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.3+name: airship+synopsis: A Webmachine-inspired HTTP library+homepage: https://github.com/tmcgilchrist/airship/+bug-reports: https://github.com/tmcgilchrist/airship/issues+version: 0.9.5+license: MIT+license-file: LICENSE+author: Reid Draper and Patrick Thomson+maintainer: Tim McGilchrist <timmcgil@gmail.com>+category: Web+build-type: Simple+cabal-version: >=1.10+description:+ A Webmachine-inspired HTTP library based off ideas from the original Erlang project <https://github.com/webmachine/webmachine>+ .+ A number of examples can be found in <https://github.com/tmcgilchrist/airship/tree/master/example> illustrating how to build airship based services.++tested-with:+ GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.2.2+ extra-source-files:- README.md Changes.md+ README.md source-repository head- type: git- location: https://github.com/helium/airship.git+ type: git+ location: https://github.com/tmcgilchrist/airship.git library- default-language: Haskell2010- hs-source-dirs: src- ghc-options: -Wall- exposed-modules: Airship- , Airship.RST- , Airship.Config- , Airship.Headers- , Airship.Helpers- , Airship.Types- , Airship.Resource- , Airship.Resource.Static- , Airship.Route+ default-language: Haskell2010+ hs-source-dirs: src+ ghc-options: -Wall+ exposed-modules:+ Airship+ Airship.Config+ Airship.Headers+ Airship.Helpers+ Airship.Resource+ Airship.Resource.Static+ Airship.Route+ Airship.RST+ Airship.Types - other-modules: Airship.Internal.Route- , Airship.Internal.Date- , Airship.Internal.Decision- , Airship.Internal.Helpers- , Airship.Internal.Parsers+ other-modules:+ Airship.Internal.Date+ Airship.Internal.Decision+ Airship.Internal.Helpers+ Airship.Internal.Parsers+ Airship.Internal.Route - build-depends: attoparsec- , base >= 4.7 && < 5- , base64-bytestring == 1.0.*- , blaze-builder >= 0.3 && < 0.5- , bytestring- , bytestring-trie >= 0.2.4 && < 0.2.6- , case-insensitive- , containers- , cryptohash == 0.11.*- , directory- , either >= 4.3 && < 6.0- , filepath >= 1.3 && < 1.5- , http-date- , http-media- , http-types >= 0.8 && < 0.13- , lifted-base == 0.2.*- , microlens- , monad-control >= 1.0- , mime-types == 0.1.0.*- , mmorph >= 1.0 && < 1.2- , mtl- , network- , old-locale- , random- , semigroups == 0.18.*- , text- , time- , transformers- , transformers-base- , unix == 2.7.*- , unordered-containers- , wai >= 3.0.3.0 && < 3.2.2- -- https://github.com/yesodweb/wai/pull/726- , wai-extra >= 3.0 && < 3.0.26+ build-depends:+ attoparsec+ , base >=4.7 && <5+ , base64-bytestring >=1.0 && <1.3+ , blaze-builder >=0.3 && <0.5+ , bytestring+ , bytestring-trie >=0.2.4 && <0.3+ , case-insensitive+ , containers+ , cryptohash >=0.11 && <0.12+ , directory+ , either >=4.3 && <6.0+ , filepath >=1.3 && <1.5+ , http-date+ , http-media+ , http-types >=0.8 && <0.13+ , lifted-base >=0.2 && <0.3+ , microlens+ , mime-types >=0.1.0 && <0.1.1+ , mmorph >=1.0 && <1.3+ , monad-control >=1.0+ , mtl+ , network+ , old-locale+ , random+ , semigroups >=0.18 && <0.21+ , text+ , time+ , transformers+ , transformers-base+ , unix >=2.7 && <2.8+ , unordered-containers+ , wai >=3.0.3.0 && <3.3+ , wai-extra >=3.0 && <3.2 +-- https://github.com/yesodweb/wai/pull/726 test-suite unit- default-language: Haskell2010- type: exitcode-stdio-1.0- hs-source-dirs: test/unit- main-is: test.hs- build-depends: base >= 4.7 && < 5- , airship- , text == 1.2.*- , bytestring >= 0.9.1 && < 0.11- , tasty >= 0.10.1 && < 1.3- , tasty-quickcheck >= 0.8.3 && < 0.11- , tasty-hunit >= 0.9.1 && < 0.11- , transformers- , wai >= 3.0 && < 3.3+ default-language: Haskell2010+ type: exitcode-stdio-1.0+ hs-source-dirs: test/unit+ main-is: test.hs+ build-depends:+ airship+ , base >=4.7 && <5+ , bytestring >=0.9.1 && <0.11+ , tasty >=0.10.1 && <1.3+ , tasty-hunit >=0.9.1 && <0.11+ , tasty-quickcheck >=0.8.3 && <0.11+ , text >=1.2 && <2.0+ , transformers+ , wai >=3.0 && <3.3 - ghc-options: -Wall -threaded -fno-warn-orphans+ ghc-options: -Wall -threaded -fno-warn-orphans
src/Airship/RST.hs view
@@ -69,18 +69,8 @@ ask = RST $ \r s -> return $! (Right r,s) local f m = RST $ \r s -> runRST m (f r) s --- Terrible hack to work around the fact that Functor isn't a superclass--- of Monad on GHC 7.8. TODO kill this when 7.8 support is dropped-#if __GLASGOW_HASKELL__ == 708-instance (Monad m) => Functor (RST r s e m) where- fmap f m = RST $ \r s -> runRST m r s >>= helper where- helper (a, s') = case a of- (Left l) -> return $! (Left l, s')- (Right r) -> return $! (Right $ f r, s')-#else instance (Functor m) => Functor (RST r s e m) where fmap f m = RST $ \r s -> fmap (\(a,s') -> (fmap f a, s')) $ runRST m r s-#endif instance Monad m => Applicative (RST r s e m) where pure = return@@ -119,8 +109,7 @@ instance (Monad m) => Monad (RST r s e m) where return a = RST $ \_ s -> return $! (Right a, s) (>>=) = rwsBind- fail msg = RST $ \_ _ -> fail msg-+ -- fail msg = RST $ \_ _ -> fail msg instance (MonadPlus m) => MonadPlus (RST r s e m) where mzero = RST $ \_ _ -> mzero