on develop help sign in
Upgrade example code for conduit >= 1.3
e2efb4cMichael Xavier
examples/src/Example/Storage.hs+3−3
@@ -15,7 +15,7 @@ module Example.Storage where
15import Control.Lens ((&), (.~), (<&>), (?~))
15import Control.Lens ((&), (.~), (<&>), (?~))
16import Control.Monad.Trans.Resource (liftResourceT, runResourceT)
16import Control.Monad.Trans.Resource (liftResourceT, runResourceT)
17
17
18−import Data.Conduit (($$+-))
18+import Data.Conduit (runConduit, (.|))
19import Data.Text (Text)
19import Data.Text (Text)
20
20
21import System.IO (stdout)
21import System.IO (stdout)
@@ -62,7 +62,7 @@ example bucket input output = do
62 -- Download from the bucket/key and create a source of the HTTP stream:
62 -- Download from the bucket/key and create a source of the HTTP stream:
63 stream <- Google.download (Storage.objectsGet bucket key)
63 stream <- Google.download (Storage.objectsGet bucket key)
64
64
65− -- 'Conduit' actions such as '$$+-' need to be lifted into the 'Google'
65+ -- 'Conduit' actions such as '.|' need to be lifted into the 'Google'
66 -- monad using 'liftResourceT', this will stream the received bytes
66 -- monad using 'liftResourceT', this will stream the received bytes
67 -- into the 'output' file:
67 -- into the 'output' file:
68− liftResourceT (stream $$+- Conduit.sinkFile output)
68+ liftResourceT (runConduit (stream .| Conduit.sinkFile output))