From 149a0470b73781022e584aaeaa7ce871d6f4173b Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 19 Jun 2018 22:49:16 +0200 Subject: Add automatic tests on remote pages --- src/executable/haskell/Utils/Either.hs | 7 ------- src/executable/haskell/Utils/HTTP.hs | 19 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 src/executable/haskell/Utils/Either.hs delete mode 100644 src/executable/haskell/Utils/HTTP.hs (limited to 'src/executable/haskell/Utils') diff --git a/src/executable/haskell/Utils/Either.hs b/src/executable/haskell/Utils/Either.hs deleted file mode 100644 index 5d62dcc..0000000 --- a/src/executable/haskell/Utils/Either.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Utils.Either - ( mapLeft - ) where - -mapLeft :: (a -> c) -> Either a b -> Either c b -mapLeft f (Left l) = Left (f l) -mapLeft _ (Right r) = (Right r) diff --git a/src/executable/haskell/Utils/HTTP.hs b/src/executable/haskell/Utils/HTTP.hs deleted file mode 100644 index 919e66d..0000000 --- a/src/executable/haskell/Utils/HTTP.hs +++ /dev/null @@ -1,19 +0,0 @@ -module Utils.HTTP - ( get - ) where - -import Control.Exception (SomeException, try) -import Data.ByteString (ByteString) -import qualified Data.ByteString.Lazy as BS -import Data.Text (Text) -import qualified Data.Text as T -import Network.HTTP.Conduit - -import Model.URL -import Utils.Either (mapLeft) - -get :: (ByteString -> Text) -> URL -> IO (Either Text Text) -get decode url = mapLeft (T.pack . show) <$> (try (unsafeGetPage decode url) :: IO (Either SomeException Text)) - -unsafeGetPage :: (ByteString -> Text) -> URL -> IO Text -unsafeGetPage decode url = (decode . BS.toStrict) <$> simpleHttp (T.unpack url) -- cgit v1.2.3