-module Data.Time.W3CDateTime.Types
+module Data.Time.W3C.Types
( W3CDateTime(..)
)
where
}
deriving (Show, Eq, Typeable)
+fetch :: (Show a, Typeable a, Typeable b) =>
+ String
+ -> (a -> Maybe b)
+ -> a
+ -> ConvertResult b
+fetch name f a
+ = case f a of
+ Nothing -> convError ("No " ++ name ++ " information in the given value") a
+ Just b -> return b
+
instance Convertible Day W3CDateTime where
safeConvert day
= case toGregorian day of
, w3cTimeZone = Nothing
}
-fetch :: (Show a, Typeable a, Typeable b) =>
- String
- -> (a -> Maybe b)
- -> a
- -> ConvertResult b
-fetch name f a
- = case f a of
- Nothing -> convError ("No " ++ name ++ " information in the given value") a
- Just b -> return b
-
instance Convertible W3CDateTime Day where
safeConvert w3c
= do let y = w3cYear w3c