git.iko.soy/typeable/postgresql-simple
on master help sign in
Use MonadFail
commit31586339b9bb40e478692cc25a84a6308bd3f22e authorOleg Grenrus <oleg.grenrus@iki.fi> dateFri 26 Apr 2019, 11:39 (7 years ago) parent0618511
4 files changed+37−6
.travis.yml+21−3 CHANGES.md+4 postgresql-simple.cabal+5−3 src/Database/PostgreSQL/Simple/Ok.hs+7
.travis.yml+21−3
@@ -4,7 +4,7 @@
44#
55# For more information, see https://github.com/haskell-CI/haskell-ci
66#
7−# version: 0.3.20190326
7+# version: 0.3.20190425
88#
99language: c
1010dist: xenial
@@ -33,8 +33,11 @@ before_cache:
3333 - rm -rfv $CABALHOME/packages/head.hackage
3434matrix:
3535 include:
36− - compiler: ghc-8.6.4
37− addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
36+ - compiler: ghc-8.8.1
37+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}}
38+ env: GHCHEAD=true
39+ - compiler: ghc-8.6.5
40+ addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}}
3841 - compiler: ghc-8.4.4
3942 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
4043 - compiler: ghc-8.2.2
@@ -47,6 +50,8 @@ matrix:
4750 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}}
4851 - compiler: ghc-7.6.3
4952 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-2.4"]}}
53+ allow_failures:
54+ - compiler: ghc-8.8.1
5055before_install:
5156 - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
5257 - HCPKG="$HC-pkg"
@@ -92,12 +97,25 @@ install:
9297 echo "world-file: $CABALHOME/world" >> $CABALHOME/config
9398 echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
9499 echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
100+ echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
95101 echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
96102 echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
97103 echo "install-dirs user" >> $CABALHOME/config
98104 echo " prefix: $CABALHOME" >> $CABALHOME/config
99105 echo "repository hackage.haskell.org" >> $CABALHOME/config
100106 echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
107+ - |
108+ if $GHCHEAD; then
109+ echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config
110+
111+ echo "repository head.hackage" >> $CABALHOME/config
112+ echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config
113+ echo " secure: True" >> $CABALHOME/config
114+ echo " root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config
115+ echo " 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config
116+ echo " 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config
117+ echo " key-threshold: 3" >> $CABALHOME/config
118+ fi
101119 - cat $CABALHOME/config
102120 - rm -fv cabal.project cabal.project.local cabal.project.freeze
103121 - travis_retry ${CABAL} v2-update -v
CHANGES.md+4
@@ -1,3 +1,7 @@
1+### Version 0.6.2 (2019-04-26)
2+
3+ * Define `MonadFail Ok`.
4+
15### Version 0.6.1 (2019-03-04)
26
37 * Escape double '??' to a literal '?
postgresql-simple.cabal+5−3
@@ -1,6 +1,6 @@
11Cabal-version: 1.12
22Name: postgresql-simple
3−Version: 0.6.1
3+Version: 0.6.2
44
55Synopsis: Mid-Level PostgreSQL client library
66Description:
@@ -28,7 +28,8 @@ tested-with:
2828 || == 8.0.2
2929 || == 8.2.2
3030 || == 8.4.4
31− || == 8.6.4
31+ || == 8.6.5
32+ || == 8.8.1
3233
3334Library
3435 default-language: Haskell2010
@@ -97,7 +98,8 @@ Library
9798
9899 if !impl(ghc >= 8.0)
99100 Build-depends:
100− semigroups >=0.18.5 && <0.19
101+ fail >=4.9.0.0 && <4.10,
102+ semigroups >=0.18.5 && <0.19
101103
102104 if !impl(ghc >= 7.6)
103105 Build-depends:
src/Database/PostgreSQL/Simple/Ok.hs+7
@@ -37,6 +37,8 @@ import Control.Exception
3737import Control.Monad(MonadPlus(..))
3838import Data.Typeable
3939
40+import qualified Control.Monad.Fail as Fail
41+
4042-- FIXME: [SomeException] should probably be something else, maybe
4143-- a difference list (or a tree?)
4244
@@ -77,6 +79,11 @@ instance Monad Ok where
7779 Errors es >>= _ = Errors es
7880 Ok a >>= f = f a
7981
82+#if !(MIN_VERSION_base(4,13,0))
83+ fail = Fail.fail
84+#endif
85+
86+instance Fail.MonadFail Ok where
8087 fail str = Errors [SomeException (ErrorCall str)]
8188
8289-- | a way to reify a list of exceptions into a single exception