Skip to content
Snippets Groups Projects
Commit ba0299b1 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Update the example program to work with ExceptT

parent 82c56d45
No related branches found
No related tags found
1 merge request!15Use ExceptT
......@@ -2,6 +2,8 @@
module Main where
import Control.Monad.Except (runExceptT)
import Control.Monad.IO.Class (MonadIO (liftIO))
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy as BL
......@@ -29,8 +31,9 @@ main = do
where
go announcements cap = do
-- Download & decode the shares
result <- download announcements cap announcementToMutableStorageServer
result <- runExceptT $ download announcements cap announcementToMutableStorageServer
-- Show the result
putStrLn "Your result:"
either print (C8.putStrLn . BL.toStrict) result
liftIO $ do
putStrLn "Your result:"
either print (C8.putStrLn . BL.toStrict) result
......@@ -181,6 +181,7 @@ executable download-sdmf
, containers >=0.6.0.1 && <0.7
, gbs-downloader
, megaparsec >=8.0 && <9.3
, mtl >=2.2.2 && <2.4
, tahoe-ssk >=0.3 && <0.4
, text >=1.2.3.1 && <1.3
, yaml >=0.11.5.0 && <0.11.9.0 || >=0.11.9.0.0 && <0.12
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment