Rename toProxy to toFormatProxy

This commit is contained in:
Alex Mason 2016-09-02 15:46:23 +10:00
parent 1996ec05f7
commit f3f61dbbac

View file

@ -9,7 +9,7 @@
module Servant.API.Times
( FTime(..)
, toProxy
, toFormatProxy
, getFormat
, renderTime
, parseTime
@ -78,11 +78,11 @@ instance (KnownSymbol format, T.ParseTime t) => FromHttpApiData (FTime format t)
parseQueryParam = parseQueryParam >=> parseTime
toProxy :: FTime format t -> Proxy format
toProxy _ = Proxy
toFormatProxy :: FTime format t -> Proxy format
toFormatProxy _ = Proxy
getFormat :: KnownSymbol format => FTime format t -> String
getFormat t = symbolVal (toProxy t)
getFormat t = symbolVal (toFormatProxy t)
renderTime :: (KnownSymbol format, T.FormatTime t) => FTime format t -> String
renderTime tt@(FTime t) = T.formatTime T.defaultTimeLocale (getFormat tt) t