Hello community,
here is the log from the commit of package ghc-servant-purescript for
openSUSE:Factory checked in at 2017-08-31 20:59:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-servant-purescript (Old)
and /work/SRC/openSUSE:Factory/.ghc-servant-purescript.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-servant-purescript"
Thu Aug 31 20:59:22 2017 rev:2 rq:513489 version:0.8.0.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-servant-purescript/ghc-servant-purescript.changes
2017-05-10 20:47:36.711448027 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-servant-purescript.new/ghc-servant-purescript.changes
2017-08-31 20:59:24.886536711 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:06:34 UTC 2017 - [email protected]
+
+- Update to version 0.8.0.0.
+
+-------------------------------------------------------------------
Old:
----
servant-purescript-0.6.0.0.tar.gz
New:
----
servant-purescript-0.8.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-servant-purescript.spec ++++++
--- /var/tmp/diff_new_pack.ht4LqB/_old 2017-08-31 20:59:25.966384989 +0200
+++ /var/tmp/diff_new_pack.ht4LqB/_new 2017-08-31 20:59:25.970384427 +0200
@@ -19,7 +19,7 @@
%global pkg_name servant-purescript
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.6.0.0
+Version: 0.8.0.0
Release: 0
Summary: Generate PureScript accessor functions for you servant API
License: BSD-3-Clause
++++++ servant-purescript-0.6.0.0.tar.gz -> servant-purescript-0.8.0.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/servant-purescript-0.6.0.0/servant-purescript.cabal
new/servant-purescript-0.8.0.0/servant-purescript.cabal
--- old/servant-purescript-0.6.0.0/servant-purescript.cabal 2016-09-28
11:42:13.000000000 +0200
+++ new/servant-purescript-0.8.0.0/servant-purescript.cabal 2017-05-03
09:09:21.000000000 +0200
@@ -1,5 +1,5 @@
name: servant-purescript
-version: 0.6.0.0
+version: 0.8.0.0
synopsis: Generate PureScript accessor functions for you servant API
description: Please see README.md
homepage: https://github.com/eskimor/servant-purescript#readme
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/servant-purescript-0.6.0.0/src/Servant/PureScript/CodeGen.hs
new/servant-purescript-0.8.0.0/src/Servant/PureScript/CodeGen.hs
--- old/servant-purescript-0.6.0.0/src/Servant/PureScript/CodeGen.hs
2016-09-28 10:16:14.000000000 +0200
+++ new/servant-purescript-0.8.0.0/src/Servant/PureScript/CodeGen.hs
2017-05-03 09:09:21.000000000 +0200
@@ -88,7 +88,7 @@
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
-genSignature = genSignatureBuilder $ "forall eff m." <+/> "(MonadReader
(SPSettings_ SPParams_) m, MonadError AjaxError m, MonadAff ( ajax :: AJAX |
eff) m)" <+/> "=>"
+genSignature = genSignatureBuilder $ "forall eff m." <+/> "MonadAsk
(SPSettings_ SPParams_) m => MonadError AjaxError m => MonadAff ( ajax :: AJAX
| eff) m" <+/> "=>"
genSignatureBuilder :: Doc -> Text -> [PSType] -> Maybe PSType -> Doc
genSignatureBuilder constraint fnName params mRet = fName <+> "::" <+> align
(constraint <+/> parameterString)
@@ -121,7 +121,7 @@
</> ", headers =" <+> "defaultRequest.headers <> reqHeaders"
</> case req ^. reqBody of
Nothing -> "}"
- Just _ -> ", content =" <+> "toNullable <<< Just <<< printJson
<<< encodeJson $ reqBody" </> "}"
+ Just _ -> ", content =" <+> "toNullable <<< Just <<< stringify
<<< encodeJson $ reqBody" </> "}"
)
</> "affResp <- affjax affReq"
</> "getResult affReq decodeJson affResp" <> line
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/servant-purescript-0.6.0.0/src/Servant/PureScript/Internal.hs
new/servant-purescript-0.8.0.0/src/Servant/PureScript/Internal.hs
--- old/servant-purescript-0.6.0.0/src/Servant/PureScript/Internal.hs
2016-09-21 14:34:12.000000000 +0200
+++ new/servant-purescript-0.8.0.0/src/Servant/PureScript/Internal.hs
2017-05-03 09:09:21.000000000 +0200
@@ -17,10 +17,10 @@
import Data.Char
import Data.Monoid
import Data.Proxy
-import Data.Set (Set)
-import qualified Data.Set as Set
-import Data.Text (Text)
-import qualified Data.Text as T
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Text (Text)
+import qualified Data.Text as T
import Data.Typeable
import Language.PureScript.Bridge
@@ -73,7 +73,7 @@
data Settings = Settings {
- _apiModuleName :: Text
+ _apiModuleName :: Text
-- | This function parameters should instead be put in a Reader monad.
--
-- 'baseUrl' will be put there by default, you can add additional
parameters.
@@ -81,8 +81,8 @@
-- If your API uses a given parameter name multiple times with different
types,
-- only the ones matching the type of the first occurrence
-- will be put in the Reader monad, all others will still be passed as
function parameter.
-, _readerParams :: Set ParamName
-, _standardImports :: ImportLines
+, _readerParams :: Set ParamName
+, _standardImports :: ImportLines
-- | If you want codegen for servant-subscriber, set this to True. See the
central-counter example
-- for a simple usage case.
, _generateSubscriberAPI :: Bool
@@ -94,19 +94,18 @@
_apiModuleName = "ServerAPI"
, _readerParams = Set.singleton baseURLId
, _standardImports = importsFromList
- [ ImportLine "Control.Monad.Reader.Class" (Set.fromList [ "class
MonadReader", "ask" ])
+ [ ImportLine "Control.Monad.Reader.Class" (Set.fromList [ "class
MonadAsk", "ask" ])
, ImportLine "Control.Monad.Error.Class" (Set.fromList [ "class
MonadError" ])
- , ImportLine "Control.Monad.Aff.Class" (Set.fromList [ "class
MonadAff", "liftAff" ])
+ , ImportLine "Control.Monad.Aff.Class" (Set.fromList [ "class
MonadAff" ])
, ImportLine "Network.HTTP.Affjax" (Set.fromList [ "AJAX" ])
- , ImportLine "Global" (Set.fromList [ "encodeURIComponent" ]) -- from
package globals
- , ImportLine "Data.Nullable" (Set.fromList [ "Nullable()",
"toNullable" ])
- , ImportLine "Servant.PureScript.Affjax" (Set.fromList [
"defaultRequest", "affjax", "AjaxError(..)" ])
+ , ImportLine "Data.Nullable" (Set.fromList [ "toNullable" ])
+ , ImportLine "Servant.PureScript.Affjax" (Set.fromList [ "AjaxError",
"defaultRequest", "affjax" ])
, ImportLine "Servant.PureScript.Settings" (Set.fromList [
"SPSettings_(..)", "gDefaultToURLPiece" ])
, ImportLine "Servant.PureScript.Util" (Set.fromList [
"encodeListQuery", "encodeURLPiece", "encodeQueryItem", "getResult",
"encodeHeader" ])
, ImportLine "Prim" (Set.fromList [ "String" ]) -- For baseURL!
, ImportLine "Data.Argonaut.Generic.Aeson" (Set.fromList [
"encodeJson", "decodeJson" ]) -- Should not be necessary - compiler bug!
, ImportLine "Data.Maybe" (Set.fromList [ "Maybe(..)"])
- , ImportLine "Data.Argonaut.Printer" (Set.fromList [ "printJson" ])
+ , ImportLine "Data.Argonaut.Core" (Set.fromList [ "stringify" ])
]
, _generateSubscriberAPI = False
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/servant-purescript-0.6.0.0/src/Servant/PureScript/MakeRequests.hs
new/servant-purescript-0.8.0.0/src/Servant/PureScript/MakeRequests.hs
--- old/servant-purescript-0.6.0.0/src/Servant/PureScript/MakeRequests.hs
2016-08-30 12:38:12.000000000 +0200
+++ new/servant-purescript-0.8.0.0/src/Servant/PureScript/MakeRequests.hs
2017-05-03 09:09:21.000000000 +0200
@@ -11,16 +11,18 @@
import Control.Lens hiding (List)
import Data.Map (Map)
-import Data.Maybe (mapMaybe, maybeToList)
import Data.Proxy (Proxy (Proxy))
import qualified Data.Set as Set
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
-import Language.PureScript.Bridge
-import Language.PureScript.Bridge (buildBridge,
defaultBridge)
-import Language.PureScript.Bridge.PSTypes (psString, psUnit)
-import Network.HTTP.Types.URI (urlEncode)
+import Language.PureScript.Bridge (ImportLine (..),
+ PSType,
+ buildBridge,
+ defaultBridge,
+ importsFromList,
+ mergeImportLines,
+ mkTypeInfo)
import Servant.Foreign
import Servant.PureScript.CodeGen hiding (genBuildHeader,
genBuildHeaders,
@@ -86,7 +88,7 @@
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
-genSignature = genSignatureBuilder $ "forall m." <+/> "MonadReader
(SPSettings_ SPParams_) m" <+/> "=>"
+genSignature = genSignatureBuilder $ "forall m." <+/> "MonadAsk (SPSettings_
SPParams_) m" <+/> "=>"
genFnBody :: [PSParam] -> Req PSType -> Doc
genFnBody rParams req = "do"
@@ -106,7 +108,7 @@
</> ", httpQuery:" <+> "reqQuery"
</> ", httpBody:" <+> case req ^. reqBody of
Nothing -> "\"\""
- Just _ -> "printJson <<< encodeJson $
reqBody"
+ Just _ -> "stringify <<< encodeJson $
reqBody"
</> "}")
</> "pure spReq"
) <> "\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/servant-purescript-0.6.0.0/src/Servant/PureScript/Subscriber.hs
new/servant-purescript-0.8.0.0/src/Servant/PureScript/Subscriber.hs
--- old/servant-purescript-0.6.0.0/src/Servant/PureScript/Subscriber.hs
2016-08-30 12:37:52.000000000 +0200
+++ new/servant-purescript-0.8.0.0/src/Servant/PureScript/Subscriber.hs
2017-05-03 09:09:21.000000000 +0200
@@ -22,10 +22,10 @@
import Servant.Foreign
import Servant.PureScript.CodeGen (docIntercalate, genFnHead,
genModuleHeader,
+ genSignatureBuilder,
getReaderParams, psVar,
reqToParams,
- reqsToImportLines,
- genSignatureBuilder)
+ reqsToImportLines)
import Servant.PureScript.Internal
import Servant.PureScript.MakeRequests hiding (genFnBody,
genFunction, genModule,
@@ -60,7 +60,7 @@
fnName = req ^. reqFuncName ^. camelCaseL
responseType = case req ^. reqReturnType of
Nothing -> psUnit
- Just t -> t
+ Just t -> t
allParamsList = makeTypedToUserParam responseType : baseURLParam :
reqToParams req
fnParams = filter (not . flip Set.member rParamsSet) allParamsList -- Use
list not set, as we don't want to change order of parameters
@@ -73,7 +73,7 @@
genSignature :: Text -> [PSType] -> Maybe PSType -> Doc
-genSignature = genSignatureBuilder $ "forall m a." <+/> "MonadReader
(SPSettings_ SPParams_) m" <+/> "=>"
+genSignature = genSignatureBuilder $ "forall m a." <+/> "MonadAsk (SPSettings_
SPParams_) m" <+/> "=>"
genFnBody :: Text -> [Text] -> Doc
genFnBody fName params = "do"