-- NOTE: this handles the decimal currency type in a shallow way, i.e., in its
-- int64-encoded form. To translate that fixed-point number (15,4) encoding 
-- you'll have to do some more work...
resCurrency :: ArgRes Currency
resCurrency v = do
   (hi,lo) <- readVarCurrency v
   return (coerceI (fromIntegral hi) * (coerceI (maxBound :: Int) + 1) +
           coerceI (fromIntegral lo))
 where
  coerceI = fromIntegral
resCurrency :: ArgRes Currency
resCurrency v = do
   (hi,lo) <- readVarCurrency v
   return (coerceI (fromIntegral hi) * (coerceI (maxBound :: Int) + 1) +
           coerceI (fromIntegral lo))
 where
  coerceI = fromIntegral
resCurrency v = do
   (hi,lo) <- readVarCurrency v
   return (coerceI (fromIntegral hi) * (coerceI (maxBound :: Int) + 1) +
           coerceI (fromIntegral lo))
 where
  coerceI = fromIntegral