hackernews 0.2.1.1 → 0.2.2.1
raw patch · 3 files changed
+9/−9 lines, 3 filesdep ~hspecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: hspec
API changes (from Hackage documentation)
+ Web.HackerNews: userDeleted :: User -> Bool
- Web.HackerNews: User :: Maybe Text -> UTCTime -> Int -> UserId -> Int -> [Int] -> User
+ Web.HackerNews: User :: Maybe Text -> UTCTime -> Int -> UserId -> Int -> [Int] -> Bool -> User
Files
- hackernews.cabal +4/−6
- src/Web/HackerNews/Client.hs +2/−2
- src/Web/HackerNews/User.hs +3/−1
hackernews.cabal view
@@ -1,5 +1,5 @@ name: hackernews-version: 0.2.1.1+version: 0.2.2.1 description: API for news.ycombinator.com license: MIT synopsis: API for Hacker News@@ -11,7 +11,7 @@ cabal-version: >=1.10 library- ghc-options: -Wall+ ghc-options: -Wall -threaded exposed-modules: Web.HackerNews other-modules: Web.HackerNews.Types , Web.HackerNews.Client@@ -26,9 +26,8 @@ build-depends: HsOpenSSL >= 0.10.5 , aeson >= 0.8.0.1 , attoparsec >= 0.12.1.2- , base >=4.7 && <4.8+ , base >= 4.7 && <4.8 , bytestring >= 0.10.4.0- , hspec >= 1.11.4 , http-streams >= 0.7.2.2 , io-streams >= 1.1.4.6 , text >= 1.2.0.0@@ -38,12 +37,11 @@ Test-Suite tests type: exitcode-stdio-1.0+ ghc-options: -rtsopts -threaded hs-source-dirs: tests main-is: Test.hs build-depends: base , hackernews- , hspec- , hspec >= 1.11.4 , hspec >= 1.11.4 , transformers default-language: Haskell2010
src/Web/HackerNews/Client.hs view
@@ -31,7 +31,7 @@ withOpenSSL $ do ctx <- baselineContextSSL con <- openConnectionSSL ctx "hacker-news.firebaseio.com" 443- result <- flip runReaderT con requests+ result <- runReaderT requests con closeConnection con return result @@ -46,7 +46,7 @@ setHeader "Connection" "Keep-Alive" setAccept "application/json" sendRequest con req emptyBody- !bytes <- receiveResponse con $ const $ Streams.read+ !bytes <- receiveResponse con $ const Streams.read return $ case bytes of Nothing -> Nothing Just bs -> do
src/Web/HackerNews/User.hs view
@@ -4,7 +4,7 @@ import Control.Applicative ((<*>), (<$>)) import Control.Monad (MonadPlus (mzero)) import Data.Aeson (FromJSON (parseJSON), Value (Object),- (.:), (.:?))+ (.:), (.:?), (.!=)) import Data.Text (Text) import Data.Time (UTCTime) @@ -19,6 +19,7 @@ , userId :: UserId , userKarma :: Int , userSubmitted :: [Int]+ , userDeleted :: Bool } deriving (Show) newtype UserId@@ -35,5 +36,6 @@ <*> (UserId <$> o .: "id") <*> o .: "karma" <*> o .: "submitted"+ <*> o .:? "deleted" .!= False parseJSON _ = mzero