Print pretty errors

Is there a library in haskell that allows you to construct such strings?

╭────────────────── wrong denominator ─────────────────╮
│  mySafeDiv num div                                   │
│                ─┬─                                   │
│                 │                                    │
│                 │ ╭───────────────────────────────╮  │
│                 ╰─│  the denominator cannot be 0  │  │
│                   ╰───────────────────────────────╯  │
╰──────────────────────────────────────────────────────╯

I would like to construct strings like these to report in a Left value that the function has failed.

1 Like

The two that come to my mind are diagnose: Beautiful error reporting done easily and chapelure: A diagnostics library for Haskell

8 Likes

There’s also trifecta.

3 Likes