packages feed

servant-generic 0.1.0.1 → 0.1.0.2

raw patch · 2 files changed

+20/−8 lines, 2 filesdep ~basedep ~servantPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, servant

API changes (from Hackage documentation)

- Servant.Generic: class GProduct f where type GToServant f where {
+ Servant.Generic: class GProduct f where {
- Servant.Generic: class Generic a where type Rep a :: * -> * where {
+ Servant.Generic: class Generic a where {
- Servant.Generic: fieldLink :: forall routes endpoint. (IsElem endpoint (ToServant (routes AsApi)), HasLink endpoint) => (routes AsApi -> endpoint) -> MkLink endpoint
+ Servant.Generic: fieldLink :: forall routes endpoint. (IsElem endpoint (ToServant (routes AsApi)), HasLink endpoint) => (routes AsApi -> endpoint) -> MkLink endpoint Link

Files

servant-generic.cabal view
@@ -1,5 +1,5 @@ name:                servant-generic-version:             0.1.0.1+version:             0.1.0.2 synopsis:            Specify Servant APIs with records. description:         Specify Servant APIs with records instead of @:\<|\>@ trees. See the <https://github.com/chpatrick/servant-generic/blob/master/README.md#tldr README> for more information. license:             MIT@@ -17,10 +17,10 @@   location: https://github.com/chpatrick/servant-generic.git  library-  exposed-modules:     Servant.Generic    -  -- other-modules:       -  -- other-extensions:    -  build-depends:       base >=4.7 && <4.11,+  exposed-modules:     Servant.Generic+  -- other-modules:+  -- other-extensions:+  build-depends:       base >=4.7 && <4.12,                        servant >= 0.7.1,                        servant-server >= 0.7.1   hs-source-dirs:      src@@ -31,7 +31,7 @@   type:                exitcode-stdio-1.0   main-is:             examples/Basic.hs   default-language:    Haskell2010-  build-depends:       base >=4.7 && <4.11,+  build-depends:       base >=4.7 && <4.12,                        servant >= 0.7.1,                        servant-server >= 0.7.1,                        servant-generic,
src/Servant/Generic.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-}@@ -81,7 +82,7 @@ fromServant = to . gfromServant  -- | A type family that applies an appropriate type family to the @api@ parameter.--- For example, passing `AsApi` will leave @api@ untouched, while @`AsServerT` m@ will produce @`ServerT` api m@. +-- For example, passing `AsApi` will leave @api@ untouched, while @`AsServerT` m@ will produce @`ServerT` api m@. type family mode :- api infixl 3 :- @@ -93,13 +94,24 @@ -- -- (Useful since servant 0.12) data AsLink+#if MIN_VERSION_servant(0,14,0)+type instance AsLink :- api = MkLink api Link+#else type instance AsLink :- api = MkLink api+#endif + -- | A type that specifies that an API record contains a server implementation. data AsServerT (m :: * -> *) type instance AsServerT m :- api = ServerT api m type AsServer = AsServerT Handler  -- | Given an API record field, create a link for that route. Only the field's type is used.-fieldLink :: forall routes endpoint. (IsElem endpoint (ToServant (routes AsApi)), HasLink endpoint) => (routes AsApi -> endpoint) -> MkLink endpoint+fieldLink :: forall routes endpoint. (IsElem endpoint (ToServant (routes AsApi)), HasLink endpoint)+          => (routes AsApi -> endpoint)+#if MIN_VERSION_servant(0,14,0)+          -> MkLink endpoint Link+#else+          -> MkLink endpoint+#endif fieldLink _ = safeLink (Proxy :: Proxy (ToServant (routes AsApi))) (Proxy :: Proxy endpoint)