@@ -122,7 +122,7 @@ runSimplePreProcessor
122122 -> Verbosity
123123 -> IO ()
124124runSimplePreProcessor pp inFile outFile verbosity = do
125- (runPreProcessor, _) <- configurePreProcessor pp verbosity
125+ (runPreProcessor, _) <- getPreProcessor pp verbosity
126126 runPreProcessor (" ." , inFile) (" ." , outFile) verbosity
127127
128128-- | A preprocessor for turning non-Haskell files with the given 'Suffix'
@@ -342,7 +342,7 @@ preprocessFile mbWorkDir searchLoc buildLoc forSDist baseFile verbosity builtinS
342342 -- Use file monitoring to only re-run the preprocessor if either the
343343 -- input file or the preprocessor itself have changed.
344344 -- See Note [Preprocessor monitoring].
345- (runPreProcessor, key) <- configurePreProcessor pp verbosity
345+ (runPreProcessor, key) <- getPreProcessor pp verbosity
346346 let recompile = liftIO $ do
347347 let destDir = i buildLoc </> takeDirectory srcStem
348348 createDirectoryIfMissingVerbose verbosity True destDir
@@ -412,7 +412,7 @@ ppUnlit =
412412 PreProcessor
413413 { platformIndependent = True
414414 , ppOrdering = unsorted
415- , configurePreProcessor = \ _ -> do
415+ , getPreProcessor = \ _ -> do
416416 let runPreProcessor = mkSimplePreProcessor $ \ inFile outFile verbosity ->
417417 withUTF8FileContents inFile $ \ contents ->
418418 either (writeUTF8File outFile) (dieWithException verbosity) (unlit inFile contents)
@@ -444,7 +444,7 @@ ppGhcCpp program xHs extraArgs _bi lbi clbi =
444444 PreProcessor
445445 { platformIndependent = False
446446 , ppOrdering = unsorted
447- , configurePreProcessor = \ verbosity' -> do
447+ , getPreProcessor = \ verbosity' -> do
448448 progVersion <- getProgVersion verbosity'
449449 let ppInfo = PreProcessorPrograms [fst progVersion]
450450 return (runPreProcessor progVersion, ppInfo)
@@ -472,8 +472,8 @@ ppGhcCpp program xHs extraArgs _bi lbi clbi =
472472 :: Verbosity
473473 -> IO (ConfiguredProgram , Version )
474474 getProgVersion verbosity = do
475- (prog, version, _ ) <-
476- requireProgramVersion
475+ (prog, version) <-
476+ requireConfiguredProgramVersion
477477 verbosity
478478 program
479479 anyVersion
@@ -485,7 +485,7 @@ ppCpphs extraArgs _bi lbi clbi =
485485 PreProcessor
486486 { platformIndependent = False
487487 , ppOrdering = unsorted
488- , configurePreProcessor = \ verbosity -> do
488+ , getPreProcessor = \ verbosity -> do
489489 progVersion <- getProgVersion verbosity
490490 let ppInfo = PreProcessorPrograms [fst progVersion]
491491 return (runPreProcessor progVersion, ppInfo)
@@ -509,8 +509,8 @@ ppCpphs extraArgs _bi lbi clbi =
509509 :: Verbosity
510510 -> IO (ConfiguredProgram , Version )
511511 getProgVersion verbosity = do
512- (prog, version, _ ) <-
513- requireProgramVersion
512+ (prog, version) <-
513+ requireConfiguredProgramVersion
514514 verbosity
515515 cpphsProgram
516516 anyVersion
@@ -522,7 +522,7 @@ ppHsc2hs bi lbi clbi =
522522 PreProcessor
523523 { platformIndependent = False
524524 , ppOrdering = unsorted
525- , configurePreProcessor = \ verbosity -> do
525+ , getPreProcessor = \ verbosity -> do
526526 progVersion <- getProgVersion verbosity
527527 let (gccProg, hsc2hsProg, _) = progVersion
528528 let ppInfo = PreProcessorPrograms [gccProg, hsc2hsProg]
@@ -560,8 +560,8 @@ ppHsc2hs bi lbi clbi =
560560 -> IO (ConfiguredProgram , ConfiguredProgram , Version )
561561 getProgVersion verbosity = do
562562 (gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi)
563- (hsc2hsProg, hsc2hsVersion, _ ) <-
564- requireProgramVersion
563+ (hsc2hsProg, hsc2hsVersion) <-
564+ requireConfiguredProgramVersion
565565 verbosity
566566 hsc2hsProgram
567567 anyVersion
@@ -721,7 +721,7 @@ ppC2hs bi lbi clbi =
721721 PreProcessor
722722 { platformIndependent = False
723723 , ppOrdering = unsorted
724- , configurePreProcessor = \ verbosity -> do
724+ , getPreProcessor = \ verbosity -> do
725725 progVersion <- getProgVersion verbosity
726726 let (gccProg, c2hsProg, _) = progVersion
727727 let ppInfo = PreProcessorPrograms [gccProg, c2hsProg]
@@ -773,8 +773,8 @@ ppC2hs bi lbi clbi =
773773 ]
774774
775775 getProgVersion verbosity = do
776- (c2hsProg, c2hsVersion, _ ) <-
777- requireProgramVersion
776+ (c2hsProg, c2hsVersion) <-
777+ requireConfiguredProgramVersion
778778 verbosity
779779 c2hsProgram
780780 (orLaterVersion (mkVersion [0 , 15 ]))
@@ -913,7 +913,7 @@ standardPP lbi prog args =
913913 PreProcessor
914914 { platformIndependent = False
915915 , ppOrdering = unsorted
916- , configurePreProcessor = \ _ ->
916+ , getPreProcessor = \ _ ->
917917 pure
918918 ( runPreProcessor
919919 , PreProcessorPrograms . maybeToList $ lookupProgram prog (withPrograms lbi)
@@ -1033,7 +1033,7 @@ represents these keys.
10331033
10341034Further, to make sure that we can get that key without actually having to run
10351035the preprocessor (which is the very thing we try to avoid), the 'PreProcessor'
1036- data structure exposes the 'configurePreProcessor ' function, which in turn
1036+ data structure exposes the 'getPreProcessor ' function, which in turn
10371037produces the actual preprocessor action together with the corresponding key,
10381038thus making sure that the two always match.
10391039
0 commit comments