packages feed

list-t-http-client (empty) → 0.1.0.1

raw patch · 4 files changed

+94/−0 lines, 4 filesdep +base-preludedep +bytestringdep +http-clientsetup-changed

Dependencies added: base-prelude, bytestring, http-client, list-t, mtl-prelude

Files

+ LICENSE view
@@ -0,0 +1,22 @@+Copyright (c) 2015, Nikita Volkov++Permission is hereby granted, free of charge, to any person+obtaining a copy of this software and associated documentation+files (the "Software"), to deal in the Software without+restriction, including without limitation the rights to use,+copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the+Software is furnished to do so, subject to the following+conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR+OTHER DEALINGS IN THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ library/ListT/HTTPClient.hs view
@@ -0,0 +1,17 @@+module ListT.HTTPClient where++import BasePrelude hiding (cons, uncons)+import MTLPrelude+import ListT+import Data.ByteString (ByteString)+import qualified Network.HTTP.Client as HC+import qualified Data.ByteString as B+++withResponse :: HC.Request -> HC.Manager -> (HC.Response (ListT IO ByteString) -> IO a) -> IO a+withResponse request manager handler = +  HC.withResponse request manager $ handler . fmap bodyReader++bodyReader :: HC.BodyReader -> ListT IO ByteString+bodyReader io =+  fix $ \loop -> lift io >>= \chunk -> if B.null chunk then mzero else cons chunk loop
+ list-t-http-client.cabal view
@@ -0,0 +1,53 @@+name:+  list-t-http-client+version:+  0.1.0.1+synopsis:+  A streaming HTTP client+category:+  Streaming, HTTP+homepage:+  https://github.com/nikita-volkov/list-t-http-client+bug-reports:+  https://github.com/nikita-volkov/list-t-http-client/issues +author:+  Nikita Volkov <nikita.y.volkov@mail.ru>+maintainer:+  Nikita Volkov <nikita.y.volkov@mail.ru>+copyright:+  (c) 2015, Nikita Volkov+license:+  MIT+license-file:+  LICENSE+build-type:+  Simple+cabal-version:+  >=1.10+++source-repository head+  type:+    git+  location:+    git://github.com/nikita-volkov/list-t-http-client.git+++library+  hs-source-dirs:+    library+  other-modules:+  exposed-modules:+    ListT.HTTPClient+  ghc-options:+    -funbox-strict-fields+  default-extensions:+    Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators+  default-language:+    Haskell2010+  build-depends:+    bytestring >= 0.10 && < 0.11,+    http-client == 0.4.*,+    list-t == 0.4.*,+    mtl-prelude >= 1 && < 3,+    base-prelude >= 0.1.19 && < 0.2