parseCopperFiles
  :: (OfxIn -> Maybe OfxOut)
  -- ^ Original function
  -> Seq (Either Text FilePath, Text)
  -> Either (NonEmptySeq (ParseConvertProofError Pinchot.Loc))
            (OfxIn -> Maybe OfxOut)
parseCopperFiles fOrig
  = fmap f . Lens.view Accuerr.isoAccuerrEither . getAccountsMap
  where
    f acctMap = importOfx acctMap fOrig


-- * Formatting Copperized data

-- | Returns a 'WholeFile' that is suitable for use as a standalone
-- file.  There is no extra whitespace at the beginning or end of the
-- text.
parseCopperFiles
  :: (OfxIn -> Maybe OfxOut)
  -- ^ Original function
  -> Seq (Either Text FilePath, Text)
  -> Either (NonEmptySeq (ParseConvertProofError Pinchot.Loc))
            (OfxIn -> Maybe OfxOut)
parseCopperFiles fOrig
  = fmap f . Lens.view Accuerr.isoAccuerrEither . getAccountsMap
  where
    f acctMap = importOfx acctMap fOrig


-- * Formatting Copperized data

-- | Returns a 'WholeFile' that is suitable for use as a standalone
-- file.  There is no extra whitespace at the beginning or end of the
-- text.
parseCopperFiles fOrig
  = fmap f . Lens.view Accuerr.isoAccuerrEither . getAccountsMap
  where
    f acctMap = importOfx acctMap fOrig


-- * Formatting Copperized data

-- | Returns a 'WholeFile' that is suitable for use as a standalone
-- file.  There is no extra whitespace at the beginning or end of the
-- text.