From 646c5996dee1fa9aa2fdead2518054302c0de0ad Mon Sep 17 00:00:00 2001 From: Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> Date: Tue, 2 May 2023 15:21:08 +0200 Subject: [PATCH] Avoid deprecated function --- exercises/practice/gigasecond/test/Tests.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exercises/practice/gigasecond/test/Tests.hs b/exercises/practice/gigasecond/test/Tests.hs index 52d992e72..8045d29c7 100644 --- a/exercises/practice/gigasecond/test/Tests.hs +++ b/exercises/practice/gigasecond/test/Tests.hs @@ -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) @@ -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 @@ -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")