servant-docs 0.11.3 → 0.11.4
raw patch · 3 files changed
+27/−20 lines, 3 filesdep +universe-basedep −control-monad-omegadep ~basedep ~base-compatdep ~lens
Dependencies added: universe-base
Dependencies removed: control-monad-omega
Dependency ranges changed: base, base-compat, lens
Files
- CHANGELOG.md +5/−0
- servant-docs.cabal +13/−12
- src/Servant/Docs/Internal.hs +9/−8
CHANGELOG.md view
@@ -1,6 +1,11 @@ [The latest version of this document is on GitHub.](https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md) [Changelog for `servant` package contains significant entries for all core packages.](https://github.com/haskell-servant/servant/blob/master/servant/CHANGELOG.md) +0.11.4+------++- Drop dependency on `control-monad-omega` in favor of `Data.Universe.Helpers` from `universe-base`.+ 0.11.3 ------
servant-docs.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: servant-docs-version: 0.11.3+version: 0.11.4 synopsis: generate API docs for your servant webservice category: Servant, Web@@ -11,19 +11,20 @@ . <https://github.com/haskell-servant/servant/blob/master/servant-docs/CHANGELOG.md CHANGELOG> -homepage: http://haskell-servant.readthedocs.org/+homepage: http://docs.servant.dev/ bug-reports: http://github.com/haskell-servant/servant/issues license: BSD3 license-file: LICENSE author: Servant Contributors maintainer: haskell-servant-maintainers@googlegroups.com-copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2018 Servant Contributors+copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors build-type: Simple tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4- || ==8.6.2+ || ==8.6.5+ || ==8.8.1 extra-source-files: CHANGELOG.md@@ -45,27 +46,27 @@ -- -- note: mtl lower bound is so low because of GHC-7.8 build-depends:- base >= 4.9 && < 4.13+ base >= 4.9 && < 4.14 , bytestring >= 0.10.8.1 && < 0.11 , text >= 1.2.3.0 && < 1.3 -- Servant dependencies build-depends:- servant == 0.15.*+ servant >= 0.15 && <0.17 -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. build-depends: aeson >= 1.4.1.0 && < 1.5 , aeson-pretty >= 0.8.5 && < 0.9- , base-compat >= 0.10.5 && < 0.11+ , base-compat >= 0.10.5 && < 0.12 , case-insensitive >= 1.2.0.11 && < 1.3- , control-monad-omega >= 0.3.1 && < 0.4- , hashable >= 1.2.7.0 && < 1.3- , http-media >= 0.7.1.3 && < 0.8+ , hashable >= 1.2.7.0 && < 1.4+ , http-media >= 0.7.1.3 && < 0.9 , http-types >= 0.12.2 && < 0.13- , lens >= 4.17 && < 4.18+ , lens >= 4.17 && < 4.19 , string-conversions >= 0.4.0.1 && < 0.5+ , universe-base >= 1.1.1 && < 1.2 , unordered-containers >= 0.2.9.0 && < 0.3 hs-source-dirs: src@@ -106,7 +107,7 @@ -- Additonal dependencies build-depends:- tasty >= 1.1.0.4 && < 1.2,+ tasty >= 1.1.0.4 && < 1.3, tasty-golden >= 2.3.2 && < 2.4, tasty-hunit >= 0.10.0.1 && < 0.11, transformers >= 0.5.2.0 && < 0.6
src/Servant/Docs/Internal.hs view
@@ -27,7 +27,6 @@ import Control.Lens (makeLenses, mapped, over, traversed, view, (%~), (&), (.~), (<>~), (^.), (|>))-import qualified Control.Monad.Omega as Omega import qualified Data.ByteString.Char8 as BSC import Data.ByteString.Lazy.Char8 (ByteString)@@ -65,6 +64,8 @@ import Servant.API.ContentTypes import Servant.API.TypeLevel +import qualified Data.Universe.Helpers as U+ import qualified Data.HashMap.Strict as HM import qualified Data.Text as T import qualified Network.HTTP.Media as M@@ -479,22 +480,22 @@ -- | Default sample Generic-based inputs/outputs. defaultSamples :: forall a. (Generic a, GToSample (Rep a)) => Proxy a -> [(Text, a)]-defaultSamples _ = Omega.runOmega $ second to <$> gtoSamples (Proxy :: Proxy (Rep a))+defaultSamples _ = second to <$> gtoSamples (Proxy :: Proxy (Rep a)) -- | @'ToSample'@ for Generics. ----- The use of @'Omega'@ allows for more productive sample generation.+-- Note: we use combinators from "Universe.Data.Helpers" for more productive sample generation. class GToSample t where- gtoSamples :: proxy t -> Omega.Omega (Text, t x)+ gtoSamples :: proxy t -> [(Text, t x)] instance GToSample U1 where- gtoSamples _ = Omega.each (singleSample U1)+ gtoSamples _ = singleSample U1 instance GToSample V1 where gtoSamples _ = empty instance (GToSample p, GToSample q) => GToSample (p :*: q) where- gtoSamples _ = render <$> ps <*> qs+ gtoSamples _ = U.cartesianProduct render ps qs where ps = gtoSamples (Proxy :: Proxy p) qs = gtoSamples (Proxy :: Proxy q)@@ -503,13 +504,13 @@ | otherwise = (ta <> ", " <> tb, a :*: b) instance (GToSample p, GToSample q) => GToSample (p :+: q) where- gtoSamples _ = lefts <|> rights+ gtoSamples _ = lefts U.+++ rights where lefts = second L1 <$> gtoSamples (Proxy :: Proxy p) rights = second R1 <$> gtoSamples (Proxy :: Proxy q) instance ToSample a => GToSample (K1 i a) where- gtoSamples _ = second K1 <$> Omega.each (toSamples (Proxy :: Proxy a))+ gtoSamples _ = second K1 <$> toSamples (Proxy :: Proxy a) instance (GToSample f) => GToSample (M1 i a f) where gtoSamples _ = second M1 <$> gtoSamples (Proxy :: Proxy f)