CouchDB 1.2.1 → 1.2.2
raw patch · 4 files changed
+26/−8 lines, 4 filesnew-uploaderPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES +7/−0
- CouchDB.cabal +7/−3
- src/Database/CouchDB/HTTP.hs +6/−1
- src/Tests.hs +6/−4
CHANGES view
@@ -1,3 +1,10 @@+1.2.2 (2015/5/6)++* Change of maintainer+* Fix Functor/Applicative instances+* Remove incorrect Content-Encoding header, needed for recent CouchDBs (#17 in old repo)+* Fix tests+ 1.2.1 (2015/4/25) * GHC 7.10 compatibility
CouchDB.cabal view
@@ -1,12 +1,12 @@ Name: CouchDB-Version: 1.2.1+Version: 1.2.2 Cabal-Version: >= 1.8 Copyright: Copyright (c) 2008-2012. License: BSD3 License-file: LICENSE Author: see the AUTHORS file-Maintainer: -Homepage: http://github.com/arjunguha/haskell-couchdb/+Maintainer: Ganesh Sittampalam <ganesh@earth.li>+Homepage: http://github.com/hsenag/haskell-couchdb/ Stability: provisional Category: Database Build-Type: Simple@@ -15,6 +15,10 @@ Description: An interface to CouchDB servers.++source-repository head+ type: git+ location: https://github.com/hsenag/haskell-couchdb flag network-uri description: Get Network.URI from the new network-uri package ? A compatibility flag, cabal will toggle it as needed.
src/Database/CouchDB/HTTP.hs view
@@ -23,6 +23,7 @@ import Network.HTTP import Network.URI import Control.Exception (bracket)+import Control.Monad (liftM) import Control.Monad.Trans (MonadIO (..)) import Data.Maybe (fromJust) import qualified Data.ByteString as BS (ByteString, length)@@ -48,7 +49,12 @@ data CouchMonad a = CouchMonad (CouchConn -> IO (a,CouchConn)) instance Applicative CouchMonad where+ pure = return+ (<*>) = ap+ instance Functor CouchMonad where+ fmap = liftM+ instance Monad CouchMonad where return a = CouchMonad $ \conn -> return (a,conn)@@ -91,7 +97,6 @@ makeHeaders bodyLen = [ Header HdrContentType "application/json"- , Header HdrContentEncoding "UTF-8" , Header HdrConnection "keep-alive" , Header HdrContentLength (show bodyLen) ]
src/Tests.hs view
@@ -1,7 +1,7 @@ module Main where import Control.Monad.Trans (liftIO)-import Control.Exception (finally)+import Control.Exception (SomeException, catch, finally) import Test.HUnit import Database.CouchDB import Database.CouchDB.JSON@@ -44,7 +44,8 @@ result <- testCase (db "haskellcouchdbtest") liftIO $ assertBool testDescription result let teardown = runCouchDB' (dropDB "haskellcouchdbtest") - let failure _ = assertFailure (testDescription ++ "; exception signalled")+ let failure :: SomeException -> Assertion+ failure _ = assertFailure (testDescription ++ "; exception signalled") action `catch` failure `finally` teardown main = do@@ -83,8 +84,9 @@ testCreate = TestCase $ assertDBEqual "create/drop database" True $ do- createDB "test1"- dropDB "test1" -- returns True since the database exists.+ dropDB "haskellcouchdbtest"+ createDB "haskellcouchdbtest"+ dropDB "haskellcouchdbtest" -- returns True since the database exists. people = [ Age "Arjun" 18, Age "Alex" 17 ]