mkOfxIn :: OFX.Transaction -> Maybe OfxIn
mkOfxIn ofxTxn = case parseProduction a'DecimalRadPer decTxt of
  Left _ -> Nothing
  Right copper -> Just ofxIn
    where
      dec = dDecimalRadPer copper
      ofxIn = OfxIn ofxTxn dec
  where
    decTxt = X.pack . OFX.txTRNAMT $ ofxTxn

-- | Takes an OfxIn and imports it to Transaction.  Rejects
-- duplicates.
mkOfxIn :: OFX.Transaction -> Maybe OfxIn
mkOfxIn ofxTxn = case parseProduction a'DecimalRadPer decTxt of
  Left _ -> Nothing
  Right copper -> Just ofxIn
    where
      dec = dDecimalRadPer copper
      ofxIn = OfxIn ofxTxn dec
  where
    decTxt = X.pack . OFX.txTRNAMT $ ofxTxn

-- | Takes an OfxIn and imports it to Transaction.  Rejects
-- duplicates.
mkOfxIn ofxTxn = case parseProduction a'DecimalRadPer decTxt of
  Left _ -> Nothing
  Right copper -> Just ofxIn
    where
      dec = dDecimalRadPer copper
      ofxIn = OfxIn ofxTxn dec
  where
    decTxt = X.pack . OFX.txTRNAMT $ ofxTxn

-- | Takes an OfxIn and imports it to Transaction.  Rejects
-- duplicates.