diff --git a/src/Language/Haskell/GHC/ExactPrint/ExactPrint.hs b/src/Language/Haskell/GHC/ExactPrint/ExactPrint.hs index 5e79c1a0..4b7a4c44 100644 --- a/src/Language/Haskell/GHC/ExactPrint/ExactPrint.hs +++ b/src/Language/Haskell/GHC/ExactPrint/ExactPrint.hs @@ -26,7 +26,7 @@ module Language.Haskell.GHC.ExactPrint.ExactPrint , makeDeltaAst -- * Configuration - , EPOptions(epAstPrint, epTokenPrint, epWhitespacePrint) + , EPOptions(epTokenPrint, epWhitespacePrint) , stringOptions , epOptions , deltaOptions @@ -129,34 +129,27 @@ defaultEPState = EPState -- | The R part of RWS. The environment. Updated via 'local' as we -- enter a new AST element, having a different anchor point. data EPOptions m a = EPOptions - { - epAstPrint :: forall ast . Data ast => GHC.Located ast -> a -> m a - , epTokenPrint :: String -> m a + { epTokenPrint :: String -> m a , epWhitespacePrint :: String -> m a } -- | Helper to create a 'EPOptions' -epOptions :: - (forall ast . Data ast - => GHC.Located ast -> a -> m a) - -> (String -> m a) - -> (String -> m a) - -> EPOptions m a -epOptions astPrint tokenPrint wsPrint = EPOptions - { - epAstPrint = astPrint -- Not used - , epWhitespacePrint = wsPrint +epOptions :: (String -> m a) + -> (String -> m a) + -> EPOptions m a +epOptions tokenPrint wsPrint = EPOptions + { epWhitespacePrint = wsPrint , epTokenPrint = tokenPrint } -- | Options which can be used to print as a normal String. stringOptions :: EPOptions Identity String -stringOptions = epOptions (\_ b -> return b) return return +stringOptions = epOptions return return -- | Options which can be used to simply update the AST to be in delta -- form, without generating output deltaOptions :: EPOptions Identity () -deltaOptions = epOptions (\_ _ -> return ()) (\_ -> return ()) (\_ -> return ()) +deltaOptions = epOptions (\_ -> return ()) (\_ -> return ()) data EPWriter a = EPWriter { output :: !a }