@@ -23,19 +23,19 @@ import Control.Error
2323import Control.Lens hiding (enum, lens)
2424import qualified Data.ByteString.Char8 as C8
2525import qualified Data.ByteString.Lazy.Builder as LBB
26−import qualified Data.ByteString.Lazy.Char8 as LBS
2726import Data.Char (isSpace)
2827import qualified Data.HashMap.Strict as Map
2928import Data.Maybe
3029import Data.Semigroup ((<>))
3130import Data.String
3231import qualified Data.Text.Lazy as LText
32+import qualified Data.Text.Lazy.Encoding as LText
3333import Gen.AST.Solve (getSolved)
3434import Gen.Formatting
3535import Gen.Syntax
3636import Gen.Types
37−import HIndent
38−import HIndent.Types
37+import qualified HIndent
38+import qualified HIndent.Types as HIndent
3939import Language.Haskell.Exts.Build (name)
4040import Language.Haskell.Exts.Pretty as PP
4141import Prelude hiding (sum)
@@ -172,10 +172,10 @@ data PP
172172
173173pp :: (Pretty a, Show a) => PP -> a -> AST Rendered
174174pp i x
175− | i == Indent = result (reformat hindentConfig Nothing Nothing p)
175+ | i == Indent = result (HIndent.reformat HIndent.defaultConfig Nothing Nothing p)
176176 | otherwise = pure (LText.pack (C8.unpack p))
177177 where
178− result = hoistEither . bimap (e . LText.pack) (LText.pack . LBS.unpack . LBB.toLazyByteString)
178+ result = hoistEither . bimap (e . LText.pack) (LText.decodeUtf8 . LBB.toLazyByteString)
179179
180180 e = flip mappend ("\nSyntax:\n" <> LText.pack (C8.unpack p) <> "\nAST:\n" <> LText.pack (show x))
181181
@@ -183,11 +183,6 @@ pp i x
183183 . C8.pack
184184 $ prettyPrintStyleMode s m x
185185
186− hindentConfig = defaultConfig
187− { configTrailingNewline = False
188− , configSortImports = False
189− }
190−
191186 s = style
192187 { mode = PageMode
193188 , lineLength = 80