serokell / coffer

Multi-backend password store with multiple frontends
4 stars 2 forks source link

Use `nyan-interpolation` #39

Closed dcastro closed 2 years ago

dcastro commented 2 years ago

Clarification and motivation

In Main.hs, we construct user-facing messages such as:

            printSuccess $
              "Set field '" +| fieldName |+
              "' to '" +| (field ^. E.value) |+
              "' (" +| (field ^. E.visibility) |+
              ") at '" +| entry ^. E.path |+ "'."

This would look less convoluted if we used some kind of interpolation. Interpolation would also make the code less prone to errors such as forgetting to open/close a single quote '.

We recently released nyan-interpolation, let's use it here.

I haven't checked if these quasiquotes produced by nyan-interpolation could be embedded in Builder expressions (I suspect they can). If so, we should also investigate whether we could use it to simplify CLI.PrettyPrint.

Acceptance criteria

We've used interpolation where possible.