-- System imports.
import Data.Time.Clock ( UTCTime )
import Data.Tuple.Curry ( uncurryN )
+import qualified Data.Vector.HFixed as H ( HVector, convert )
import qualified GHC.Generics as GHC ( Generic )
import Test.Tasty ( TestTree, testGroup )
import Test.Tasty.HUnit ( (@?=), testCase )
xpWrap )
-- Local imports.
-import Generics ( Generic(..), to_tuple )
import TSN.DbImport ( ImportResult(..) )
import TSN.Picklers ( xp_time_stamp )
import Xml ( pickle_unpickle, unpickleable )
UTCTime -- time_stamp
deriving (Eq, GHC.Generic, Show)
--- | For 'Generics.to_tuple'.
+-- | For 'H.convert'.
--
-instance Generic Message
+instance H.HVector Message
-- | A (un)pickler that turns a Heartbeat XML file into a 'Message'
pickle_message :: PU Message
pickle_message =
xpElem "message" $
- xpWrap (from_tuple, to_tuple) $
+ xpWrap (from_tuple, H.convert) $
xpTriple (xpElem "XML_File_ID" xpInt)
(xpElem "heading" xpText)
(xpElem "time_stamp" xp_time_stamp)