Incompatibilities with `-f-text`

Open
#264 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
tooling

Research direction

Start by reproducing the reported -f-text build failures and inspect the remaining compatibility sources: src/Text/PrettyPrint/Leijen.hs and src/Text/PrettyPrint/Annotated/Leijen.hs. Check the listed Text and renderLazy errors, then verify that the affected compatibility packages compile successfully; the ansi-terminal failures are already fixed by #279.

Written by the indexing model from the issue text.

Description

prettyprinter-compat-wl-pprint:

src/Text/PrettyPrint/Leijen.hs:181:20: error: [GHC-76037]
    Not in scope: ‘NewT.renderLazy’
    Note: The module ‘Prettyprinter.Render.Text’ does not export ‘renderLazy’.
    Suggested fix:
      Perhaps use ‘NewT.renderIO’ (imported from Prettyprinter.Render.Text)
    |
181 |     let rendered = NewT.renderLazy sdoc
    |                    ^^^^^^^^^^^^^^^

prettyprinter-compat-annotated-wl-pprint:

src/Text/PrettyPrint/Annotated/Leijen.hs:115:76: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘T.Text’
      Expected: T.Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the first argument of ‘T.unpack’, namely ‘str’
      In the first argument of ‘showString’, namely ‘(T.unpack str)’
      In the second argument of ‘(.)’, namely ‘showString (T.unpack str)’
    |
115 |     go s d stk             (SText _ str x)  = go (s . showString (T.unpack str)) d stk x
    |                                                                            ^^^

src/Text/PrettyPrint/Annotated/Leijen.hs:131:51: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘T.Text’
      Expected: T.Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the first argument of ‘T.unpack’, namely ‘s’
      In the first argument of ‘str’, namely ‘(T.unpack s)’
      In the first argument of ‘(<++>)’, namely ‘str (T.unpack s)’
    |
131 |     go stk       (SText _ s x)    = str (T.unpack s) <++> go stk x
    |                                                   ^

src/Text/PrettyPrint/Annotated/Leijen.hs:152:65: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘T.Text’
      Expected: T.Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the first argument of ‘T.unpack’, namely ‘s’
      In the expression: T.unpack s
      In the first argument of ‘mapFst’, namely ‘(T.unpack s ++)’
    |
152 |     go i stk                (SText l s x)    = mapFst (T.unpack s ++) (go (i + l) stk x)
    |                                                                 ^

src/Text/PrettyPrint/Annotated/Leijen.hs:174:38: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘T.Text’
      Expected: T.Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the second argument of ‘T.hPutStr’, namely ‘s’
      In the first argument of ‘(>>)’, namely ‘T.hPutStr h s’
      In the expression: T.hPutStr h s >> go x
    |
174 |      go (SText _ s x)  = T.hPutStr h s >> go x
    |                                      ^

prettyprinter-ansi-terminal: Fixed by #279.

src/Prettyprinter/Render/Terminal/Internal.hs:158:44: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘Text’
      Expected: Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the first argument of ‘TLB.fromText’, namely ‘t’
      In the first argument of ‘(<>)’, namely ‘TLB.fromText t’
      In the expression: TLB.fromText t <> go s rest
    |
158 |             SText _ t rest -> TLB.fromText t <> go s rest
    |                                            ^

src/Prettyprinter/Render/Terminal/Internal.hs:211:29: error: [GHC-83865]
    • Couldn't match type ‘[Char]’ with ‘Text’
      Expected: Text
        Actual: prettyprinter-1.7.1:Data.Text.Text
    • In the second argument of ‘T.hPutStr’, namely ‘t’
      In a stmt of a 'do' block: T.hPutStr h t
      In the expression:
        do T.hPutStr h t
           go rest
    |
211 |                 T.hPutStr h t
    |                             ^
Dominant language
Haskell
Stars
309
Forks
43
Avg merge
21h 25m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell-prettyprinter/prettyprinter

All issues in haskell-prettyprinter/prettyprinter

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.