Skip to content

Commit

Permalink
Avoid deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBlom committed May 2, 2023
1 parent 43eccdd commit 646c599
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions exercises/practice/gigasecond/test/Tests.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE TypeApplications #-}
import Data.Time.Clock (UTCTime)
import Test.Hspec (Spec, describe, it, shouldBe)
import Test.Hspec.Runner (configFailFast, defaultConfig, hspecWith)
Expand All @@ -8,9 +9,12 @@ import Data.Time.Format
( ParseTime
, TimeLocale
, defaultTimeLocale
, iso8601DateFormat
, parseTimeOrError
)
import Data.Time.Format.ISO8601
( ISO8601 (iso8601Format),
formatShow,
)

readTime :: ParseTime t => TimeLocale -> String -> String -> t
readTime = parseTimeOrError True
Expand All @@ -22,7 +26,7 @@ specs :: Spec
specs = describe "fromDay" $ do

let dt = readTime defaultTimeLocale
(iso8601DateFormat (Just "%T%Z")) :: String -> UTCTime
(formatShow (iso8601Format @UTCTime) undefined) :: String -> UTCTime

it "from apr 25 2011" $
fromDay (dt "2011-04-25T00:00:00Z")
Expand Down

0 comments on commit 646c599

Please sign in to comment.