From 3ef237e4d10da17dc3e610f12bf8d18530156209 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Thu, 16 Nov 2017 10:58:31 -0800 Subject: [PATCH] Update examples to use stackage version used by library (#78) --- README.md | 2 +- examples/BucketExists.hs | 2 +- examples/CopyObject.hs | 8 ++++---- examples/FileUploader.hs | 23 ++++++++++++----------- examples/GetObject.hs | 14 +++++++------- examples/HeadObject.hs | 12 ++++++------ examples/ListBuckets.hs | 10 +++++----- examples/ListIncompleteUploads.hs | 12 ++++++------ examples/ListObjects.hs | 6 +++--- examples/Makebucket.hs | 4 ++-- examples/PresignedPutObject.hs | 4 ++-- examples/PutObject.hs | 2 +- examples/RemoveIncompleteUpload.hs | 8 ++++---- examples/RemoveObject.hs | 8 ++++---- examples/Removebucket.hs | 4 ++-- 15 files changed, 60 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 04153ef..5be1587 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ stack haddock ### FileUploader.hs ``` haskell #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs --package optparse-applicative --package filepath +-- stack --resolver lts-9.1 runghc --package minio-hs --package optparse-applicative --package filepath {-# Language OverloadedStrings, ScopedTypeVariables #-} import Network.Minio diff --git a/examples/BucketExists.hs b/examples/BucketExists.hs index 8c1fa0a..db6d326 100755 --- a/examples/BucketExists.hs +++ b/examples/BucketExists.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. diff --git a/examples/CopyObject.hs b/examples/CopyObject.hs index b91b88d..15698d5 100755 --- a/examples/CopyObject.hs +++ b/examples/CopyObject.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,11 +17,11 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} import Network.Minio import Control.Monad.Catch (catchIf) -import qualified Data.Text as T +import qualified Data.Text as T import Prelude -- | The following example uses minio's play server at @@ -55,5 +55,5 @@ main = do } case res1 of - Left e -> putStrLn $ "copyObject failed." ++ (show e) + Left e -> putStrLn $ "copyObject failed." ++ (show e) Right () -> putStrLn "copyObject succeeded." diff --git a/examples/FileUploader.hs b/examples/FileUploader.hs index e0fcd47..a518b29 100755 --- a/examples/FileUploader.hs +++ b/examples/FileUploader.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs --package optparse-applicative --package filepath +-- stack --resolver lts-9.1 runghc --package minio-hs --package optparse-applicative --package filepath -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -18,16 +18,17 @@ -- -{-# Language OverloadedStrings, ScopedTypeVariables #-} -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +import Network.Minio -import Control.Monad.Catch (catchIf) -import Control.Monad.IO.Class (liftIO) -import Data.Monoid ((<>)) -import Data.Text (pack) -import Options.Applicative -import Prelude -import System.FilePath.Posix +import Control.Monad.Catch (catchIf) +import Control.Monad.IO.Class (liftIO) +import Data.Monoid ((<>)) +import Data.Text (pack) +import Options.Applicative +import Prelude +import System.FilePath.Posix -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated @@ -69,5 +70,5 @@ main = do fPutObject bucket object filepath case res of - Left e -> putStrLn $ "file upload failed due to " ++ (show e) + Left e -> putStrLn $ "file upload failed due to " ++ (show e) Right () -> putStrLn "file upload succeeded." diff --git a/examples/GetObject.hs b/examples/GetObject.hs index 4793f56..b4ead1a 100755 --- a/examples/GetObject.hs +++ b/examples/GetObject.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,12 +17,12 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +import Network.Minio -import Data.Conduit (($$+-)) -import Data.Conduit.Binary (sinkLbs) -import Prelude +import Data.Conduit (($$+-)) +import Data.Conduit.Binary (sinkLbs) +import Prelude -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated @@ -41,5 +41,5 @@ main = do (src $$+- sinkLbs) case res of - Left e -> putStrLn $ "getObject failed." ++ (show e) + Left e -> putStrLn $ "getObject failed." ++ (show e) Right _ -> putStrLn "getObject succeeded." diff --git a/examples/HeadObject.hs b/examples/HeadObject.hs index 1f4b04b..851a50a 100755 --- a/examples/HeadObject.hs +++ b/examples/HeadObject.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,11 +17,11 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} -import Network.Minio.S3API -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +import Network.Minio +import Network.Minio.S3API -import Prelude +import Prelude -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated @@ -39,5 +39,5 @@ main = do headObject bucket object case res of - Left e -> putStrLn $ "headObject failed." ++ show e + Left e -> putStrLn $ "headObject failed." ++ show e Right objInfo -> putStrLn $ "headObject succeeded." ++ show objInfo diff --git a/examples/ListBuckets.hs b/examples/ListBuckets.hs index ec2fba7..549bb17 100755 --- a/examples/ListBuckets.hs +++ b/examples/ListBuckets.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,11 +17,11 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +import Network.Minio -import Control.Monad.IO.Class (liftIO) -import Prelude +import Control.Monad.IO.Class (liftIO) +import Prelude -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated diff --git a/examples/ListIncompleteUploads.hs b/examples/ListIncompleteUploads.hs index 612601f..054d101 100755 --- a/examples/ListIncompleteUploads.hs +++ b/examples/ListIncompleteUploads.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,12 +17,12 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +import Network.Minio -import Data.Conduit (($$)) -import Data.Conduit.Combinators (sinkList) -import Prelude +import Data.Conduit (($$)) +import Data.Conduit.Combinators (sinkList) +import Prelude -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated diff --git a/examples/ListObjects.hs b/examples/ListObjects.hs index b852a31..c76d695 100755 --- a/examples/ListObjects.hs +++ b/examples/ListObjects.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,10 +17,10 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} import Network.Minio -import qualified Data.Conduit as C +import qualified Data.Conduit as C import qualified Data.Conduit.Combinators as CC import Prelude diff --git a/examples/Makebucket.hs b/examples/Makebucket.hs index 9728219..83d09fd 100755 --- a/examples/Makebucket.hs +++ b/examples/Makebucket.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -18,7 +18,7 @@ -- -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} import Network.Minio import Prelude diff --git a/examples/PresignedPutObject.hs b/examples/PresignedPutObject.hs index ed8612d..f6f0b12 100755 --- a/examples/PresignedPutObject.hs +++ b/examples/PresignedPutObject.hs @@ -40,7 +40,7 @@ main = do res <- runMinio minioPlayCI $ do -- generate a URL with 7 days expiry time - presignedPutObjectURL "my-bucket" "my-object" (7*24*3600) headers + presignedPutObjectUrl "my-bucket" "my-object" (7*24*3600) headers case res of Left e -> putStrLn $ "presignedPutObject URL failed." ++ show e @@ -54,6 +54,6 @@ main = do ["curl "] ++ map hdrOpt headers ++ ["-T /tmp/myfile", B.concat ["'", url, "'"]] - B.putStrLn $ "The following curl command would use the presigned " ++ + putStrLn $ "The following curl command would use the presigned " ++ "URL to upload the file at \"/tmp/myfile\":" B.putStrLn curlCmd diff --git a/examples/PutObject.hs b/examples/PutObject.hs index 78bd3b5..86b0adf 100755 --- a/examples/PutObject.hs +++ b/examples/PutObject.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. diff --git a/examples/RemoveIncompleteUpload.hs b/examples/RemoveIncompleteUpload.hs index adda4db..cf1999f 100755 --- a/examples/RemoveIncompleteUpload.hs +++ b/examples/RemoveIncompleteUpload.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,10 +17,10 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} -import Network.Minio +{-# LANGUAGE OverloadedStrings #-} +import Network.Minio -import Prelude +import Prelude -- | The following example uses minio's play server at -- https://play.minio.io:9000. The endpoint and associated diff --git a/examples/RemoveObject.hs b/examples/RemoveObject.hs index 5661f14..e901c51 100755 --- a/examples/RemoveObject.hs +++ b/examples/RemoveObject.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -17,10 +17,10 @@ -- limitations under the License. -- -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} -import Network.Minio -import Prelude +import Network.Minio +import Prelude main :: IO () main = do diff --git a/examples/Removebucket.hs b/examples/Removebucket.hs index f298196..6b219f3 100755 --- a/examples/Removebucket.hs +++ b/examples/Removebucket.hs @@ -1,5 +1,5 @@ #!/usr/bin/env stack --- stack --resolver lts-8.5 runghc --package minio-hs +-- stack --resolver lts-9.1 runghc --package minio-hs -- -- Minio Haskell SDK, (C) 2017 Minio, Inc. @@ -18,7 +18,7 @@ -- -{-# Language OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} import Network.Minio import Prelude