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/
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
RecordWildCards
TypeOperators
build-depends:
aeson
aeson < 2.3
, base >=4.7 && <5
, ghc
, http-client
, http-client-tls
, lens
, servant
, servant-client
, servant >= 0.18.3 && < 0.20
, servant-client >= 0.18.3 && < 0.20
, text
default-language: Haskell2010
......
......@@ -5,7 +5,6 @@ module ISTEX.Client where
import Control.Applicative ((<|>))
import Data.Aeson
import GHC.Generics
import Panic (panic)
import Text.Read (readEither)
import Servant.API
......@@ -36,7 +35,7 @@ parsePubDate :: Maybe T.Text -> Maybe Int
parsePubDate Nothing = Nothing
parsePubDate (Just pubDate) =
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'
where
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