haskell-prettyprinter / haskell-prettyprinter/prettyprinter

A version of Terminal.renderIO that checks ANSI support?

Open
#88 5 comments 0 reactions 0 assignees View on GitHub
Feature request
Dominant language
Haskell
Stars
309
Forks
43
Avg merge
21h 25m
Merged PRs (30d)
1

Description

This is a common pattern in `dhall`:

```haskell
do
supportsANSI <- System.Console.ANSI.hSupportsANSI System.IO.stdout

Pretty.Terminal.renderIO
System.IO.stdout
(if supportsANSI
then docStream
else (Pretty.unAnnotateS docStream))
```

Could `prettyprinter-ansi-terminal` export a version of `renderIO` so I could write something like this instead?

```haskell
Pretty.Terminal.renderIOCheck System.IO.stdout docStream

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.