FlexibleInstances
, MultiParamTypeClasses
, OverloadedStrings
+ , TemplateHaskell
, UnicodeSyntax
#-}
-- |This module provides functions for ANSI C's asctime() format.
{-# INLINE convertSuccess #-}
convertSuccess = (A.fromAsciiBuilder <$>) ∘ cs
-instance ConvertAttempt LocalTime (Tagged Asctime Ascii) where
- {-# INLINE convertAttempt #-}
- convertAttempt = return ∘ cs
-
instance ConvertSuccess LocalTime (Tagged Asctime AsciiBuilder) where
{-# INLINE convertSuccess #-}
convertSuccess = Tagged ∘ toAsciiBuilder
-instance ConvertAttempt LocalTime (Tagged Asctime AsciiBuilder) where
- {-# INLINE convertAttempt #-}
- convertAttempt = return ∘ cs
-
instance ConvertAttempt (Tagged Asctime Ascii) LocalTime where
{-# INLINE convertAttempt #-}
convertAttempt = parseAttempt' asctime ∘ untag
⊕ show2 (floor (todSec timeOfDay) ∷ Int)
⊕ A.toAsciiBuilder " "
⊕ show4 year
+
+deriveAttempts [ ([t| LocalTime |], [t| Tagged Asctime Ascii |])
+ , ([t| LocalTime |], [t| Tagged Asctime AsciiBuilder |])
+ ]