From 671c8b4bf1f2f65fded56ac192bab50a3261b711 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Tue, 21 May 2024 19:01:24 +0100 Subject: [PATCH] Remove epAstPrint It is not used --- .../Haskell/GHC/ExactPrint/ExactPrint.hs | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) 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 }