Remove use of undefined in Read instance

This commit is contained in:
Alex Mason 2016-09-02 15:45:31 +10:00
parent bbd6779cc5
commit 1996ec05f7

View file

@ -54,6 +54,7 @@ instance (KnownSymbol format, T.FormatTime t) => Show (FTime format t) where
instance (KnownSymbol format, T.ParseTime t) => Read (FTime format t) where
readsPrec i str = res
where
fmt = symbolVal (Proxy :: Proxy format)
res = fmap (first FTime)
(readParen (i > 1)
#if !MIN_VERSION_time(1,5,0)
@ -64,12 +65,6 @@ instance (KnownSymbol format, T.ParseTime t) => Read (FTime format t) where
str
)
toFTimeTy :: [(FTime format t, String)] -> FTime format t
toFTimeTy _ = undefined
fmt = getFormat (toFTimeTy res)
instance (KnownSymbol format, T.FormatTime t) => ToHttpApiData (FTime format t) where
toUrlPiece = toUrlPiece . renderTime