Commit eef5c951 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Make it build cleanly on GHC 8.10.7 and GHC 9.4.7

parent a34bb341
.stack-work/ .stack-work/
crawlerISTEX.cabal crawlerISTEX.cabal
*~ *~
\ No newline at end of file dist-newstyle
tags
with-compiler: ghc-9.4.7
packages: .
tests: True
packages: .
with-compiler: ghc-8.10.7
...@@ -41,14 +41,14 @@ library ...@@ -41,14 +41,14 @@ library
RecordWildCards RecordWildCards
TypeOperators TypeOperators
build-depends: build-depends:
aeson aeson < 2.3
, base >=4.7 && <5 , base >=4.7 && <5
, ghc , ghc
, http-client , http-client
, http-client-tls , http-client-tls
, lens , lens
, servant , servant >= 0.18.3 && < 0.20
, servant-client , servant-client >= 0.18.3 && < 0.20
, text , text
default-language: Haskell2010 default-language: Haskell2010
......
...@@ -5,7 +5,6 @@ module ISTEX.Client where ...@@ -5,7 +5,6 @@ module ISTEX.Client where
import Control.Applicative ((<|>)) import Control.Applicative ((<|>))
import Data.Aeson import Data.Aeson
import GHC.Generics import GHC.Generics
import Panic (panic)
import Text.Read (readEither) import Text.Read (readEither)
import Servant.API import Servant.API
...@@ -36,7 +35,7 @@ parsePubDate :: Maybe T.Text -> Maybe Int ...@@ -36,7 +35,7 @@ parsePubDate :: Maybe T.Text -> Maybe Int
parsePubDate Nothing = Nothing parsePubDate Nothing = Nothing
parsePubDate (Just pubDate) = parsePubDate (Just pubDate) =
case ePubDate of case ePubDate of
Left err -> panic $ T.unpack $ "[parseJSON] Cannot parse publicationDate (Int): " <> pubDate <> "(" <> (T.pack err) <> ")" Left err -> error $ T.unpack $ "[parseJSON] Cannot parse publicationDate (Int): " <> pubDate <> "(" <> (T.pack err) <> ")"
Right pubDate' -> Just pubDate' Right pubDate' -> Just pubDate'
where where
ePubDate = readEither (T.unpack pubDate) :: Either String Int ePubDate = readEither (T.unpack pubDate) :: Either String Int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment