Skip to content

Commit

Permalink
Fix some ambiguities.
Browse files Browse the repository at this point in the history
  • Loading branch information
robrix committed Oct 18, 2020
1 parent c56cb86 commit 6c0436c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Facet/Pretty.hs
Expand Up @@ -34,7 +34,7 @@ import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Builder as TLB
import Facet.Stack
import qualified Prettyprinter as PP
import qualified Prettyprinter.Render.Terminal as ANSI
import qualified Prettyprinter.Render.Terminal as PP
import qualified Prettyprinter.Render.Terminal.Internal as PPI
import Silkscreen hiding (column, width)
import qualified System.Console.ANSI as ANSI
Expand All @@ -48,18 +48,18 @@ layoutOptionsForTerminal = do
s <- maybe 80 Size.width <$> Size.size
pure PP.defaultLayoutOptions{ PP.layoutPageWidth = PP.AvailablePerLine s 0.8 }

hPutDoc :: MonadIO m => Handle -> PP.Doc ANSI.AnsiStyle -> m ()
hPutDoc :: MonadIO m => Handle -> PP.Doc PP.AnsiStyle -> m ()
hPutDoc handle doc = liftIO $ do
opts <- layoutOptionsForTerminal
ANSI.renderIO handle (PP.layoutSmart opts (doc <> PP.line))
PP.renderIO handle (PP.layoutSmart opts (doc <> PP.line))

hPutDocWith :: MonadIO m => Handle -> (a -> ANSI.AnsiStyle) -> PP.Doc a -> m ()
hPutDocWith :: MonadIO m => Handle -> (a -> PP.AnsiStyle) -> PP.Doc a -> m ()
hPutDocWith handle style = hPutDoc handle . PP.reAnnotate style

putDoc :: MonadIO m => PP.Doc ANSI.AnsiStyle -> m ()
putDoc :: MonadIO m => PP.Doc PP.AnsiStyle -> m ()
putDoc = hPutDoc stdout

putDocWith :: MonadIO m => (a -> ANSI.AnsiStyle) -> PP.Doc a -> m ()
putDocWith :: MonadIO m => (a -> PP.AnsiStyle) -> PP.Doc a -> m ()
putDocWith = hPutDocWith stdout


Expand Down

0 comments on commit 6c0436c

Please sign in to comment.