dumpClassesIfSet :: HscEnv -> [(String, String, ByteString)] -> IO ()
dumpClassesIfSet hsc_env classes =
  when (dopt Opt_D_dump_interpreted_classes dflags) $ do
    let clsPaths = map (\(a,_,c) -> (toClassFilePath a, c)) classes
    forM_ clsPaths $ \(p, c) -> do
      createDirectoryIfMissing True (takeDirectory p)
      B.writeFile p c
  where dflags = hsc_dflags hsc_env
        dump = fromMaybe "." (dumpDir dflags)
        toClassFilePath c = dump </> "interpreted" </> c <.> ".class"
dumpClassesIfSet :: HscEnv -> [(String, String, ByteString)] -> IO ()
dumpClassesIfSet hsc_env classes =
  when (dopt Opt_D_dump_interpreted_classes dflags) $ do
    let clsPaths = map (\(a,_,c) -> (toClassFilePath a, c)) classes
    forM_ clsPaths $ \(p, c) -> do
      createDirectoryIfMissing True (takeDirectory p)
      B.writeFile p c
  where dflags = hsc_dflags hsc_env
        dump = fromMaybe "." (dumpDir dflags)
        toClassFilePath c = dump </> "interpreted" </> c <.> ".class"
dumpClassesIfSet hsc_env classes =
  when (dopt Opt_D_dump_interpreted_classes dflags) $ do
    let clsPaths = map (\(a,_,c) -> (toClassFilePath a, c)) classes
    forM_ clsPaths $ \(p, c) -> do
      createDirectoryIfMissing True (takeDirectory p)
      B.writeFile p c
  where dflags = hsc_dflags hsc_env
        dump = fromMaybe "." (dumpDir dflags)
        toClassFilePath c = dump </> "interpreted" </> c <.> ".class"