Skip to content

[#395] Switch to home-grown string interpolation

Nikolay Yakimov requested to merge lierdakil/#395-use-neat-interpolation into master

Description

Not updating changelogs, want to see if it passes all tests first (particularly doctests, since running those locally is a bit of a chore)


Problem: interpolate, which we use for string interpolation, is quite dependency-heavy, and we do not actually use the features those dependencies are required for.

Solution: make our own. See "Morley.Util.StringInterpolation" for documentation.

One feature we lose is the ability to use expressions inside interpolated strings, but we didn't actually use it anywhere, and anyway it's arguably way cleaner to write, e.g.

[md|${one} ${two}|] where
  one = pretty bigExpression
  two = pretty evenBiggerExpression

than inline those expressions in the string.

Related issue(s)

Resolves #395 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Nikolay Yakimov

Merge request reports