From b3f35d9ed5eb0c1cf5fdf3a2225083dfacd4d278 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 2 Jan 2015 17:32:15 -0500 Subject: [PATCH] Migrate TSN.XML.Heartbeat to fixed-vector-hetero. --- src/TSN/XML/Heartbeat.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TSN/XML/Heartbeat.hs b/src/TSN/XML/Heartbeat.hs index b44f930..39a2bc4 100644 --- a/src/TSN/XML/Heartbeat.hs +++ b/src/TSN/XML/Heartbeat.hs @@ -13,6 +13,7 @@ where -- 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 ) @@ -27,7 +28,6 @@ import Text.XML.HXT.Core ( xpWrap ) -- Local imports. -import Generics ( Generic(..), to_tuple ) import TSN.DbImport ( ImportResult(..) ) import TSN.Picklers ( xp_time_stamp ) import Xml ( pickle_unpickle, unpickleable ) @@ -48,9 +48,9 @@ data Message = 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' @@ -59,7 +59,7 @@ instance Generic 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) -- 2.43.2