-- | Lift a unary function and apply to every member of a PortStats record.    
liftIntoPortStats1 :: (Double -> Double) -> PortStats -> PortStats
liftIntoPortStats1 f pr1 = 
  PortStats { portStatsReceivedPackets      = liftM f (portStatsReceivedPackets pr1),
              portStatsSentPackets          = liftM f (portStatsSentPackets pr1),
              portStatsReceivedBytes        = liftM f (portStatsReceivedBytes pr1),
              portStatsSentBytes            = liftM f (portStatsSentBytes pr1),
              portStatsReceiverDropped      = liftM f (portStatsReceiverDropped pr1),
              portStatsSenderDropped        = liftM f (portStatsSenderDropped pr1),
              portStatsReceiveErrors        = liftM f (portStatsReceiveErrors pr1),
              portStatsTransmitError        = liftM f (portStatsTransmitError pr1),
              portStatsReceivedFrameErrors  = liftM f (portStatsReceivedFrameErrors pr1),
              portStatsReceiverOverrunError = liftM f (portStatsReceiverOverrunError pr1),
              portStatsReceiverCRCError     = liftM f (portStatsReceiverCRCError pr1),
              portStatsCollisions           = liftM f (portStatsCollisions pr1)
            }
liftIntoPortStats1 :: (Double -> Double) -> PortStats -> PortStats
liftIntoPortStats1 f pr1 = 
  PortStats { portStatsReceivedPackets      = liftM f (portStatsReceivedPackets pr1),
              portStatsSentPackets          = liftM f (portStatsSentPackets pr1),
              portStatsReceivedBytes        = liftM f (portStatsReceivedBytes pr1),
              portStatsSentBytes            = liftM f (portStatsSentBytes pr1),
              portStatsReceiverDropped      = liftM f (portStatsReceiverDropped pr1),
              portStatsSenderDropped        = liftM f (portStatsSenderDropped pr1),
              portStatsReceiveErrors        = liftM f (portStatsReceiveErrors pr1),
              portStatsTransmitError        = liftM f (portStatsTransmitError pr1),
              portStatsReceivedFrameErrors  = liftM f (portStatsReceivedFrameErrors pr1),
              portStatsReceiverOverrunError = liftM f (portStatsReceiverOverrunError pr1),
              portStatsReceiverCRCError     = liftM f (portStatsReceiverCRCError pr1),
              portStatsCollisions           = liftM f (portStatsCollisions pr1)
            }
liftIntoPortStats1 f pr1 = 
  PortStats { portStatsReceivedPackets      = liftM f (portStatsReceivedPackets pr1),
              portStatsSentPackets          = liftM f (portStatsSentPackets pr1),
              portStatsReceivedBytes        = liftM f (portStatsReceivedBytes pr1),
              portStatsSentBytes            = liftM f (portStatsSentBytes pr1),
              portStatsReceiverDropped      = liftM f (portStatsReceiverDropped pr1),
              portStatsSenderDropped        = liftM f (portStatsSenderDropped pr1),
              portStatsReceiveErrors        = liftM f (portStatsReceiveErrors pr1),
              portStatsTransmitError        = liftM f (portStatsTransmitError pr1),
              portStatsReceivedFrameErrors  = liftM f (portStatsReceivedFrameErrors pr1),
              portStatsReceiverOverrunError = liftM f (portStatsReceiverOverrunError pr1),
              portStatsReceiverCRCError     = liftM f (portStatsReceiverCRCError pr1),
              portStatsCollisions           = liftM f (portStatsCollisions pr1)
            }