Dhall-haskell: escaping string fail on multiline Text for pattern similiar with string interpolation

Created on 31 Oct 2019  路  8Comments  路  Source: dhall-lang/dhall-haskell

this works fine on single line string

{
  run = "cross build --target \${{ matrix.arch }} --release"
}

but it fail on multi line string

{
  run = ''
    cross build --target \${{ matrix.arch }} --release
  ''
}

All 8 comments

In multi-line strings you can use '' for escaping:

{
  run = ''
    cross build --target ''${{ matrix.arch }} --release
  ''
}

I had to look this up in the grammar!

Ah, you are right! Thought it a bit weird 馃
I guess this is not yet documented?

I guess this is not yet documented?

Maybe it should be documented better. Where would you have expected to find documentation on this?

Most of the time when I begin to write dhall, I open the wiki with a lot of tab 馃槄. What I mostly visit is cheatsheet (also both prelude source code and gh-release page).

Summary, I open a lot of tabs with cheatsheet, prelude, and gh-release page in the dedicated browser window. So 3 window and each have several tabs 馃槀.
It would be nice if everything is in the dedicated website (or even better, all information can be accessed offline).

Thanks for the feedback @DrSensor. It's good to know how these resources are being used!

I have added an example of escaped interpolation to the Text section of https://github.com/dhall-lang/dhall-lang/wiki/Cheatsheet.

even better, all information can be accessed offline

Note that you can make a local clone of the wiki with

git clone https://github.com/dhall-lang/dhall-lang.wiki.git

I already know that. I prefer offline media where I can read it on the mobile phone like pdf or devdocs

@DrSensor: Once Dhall gets 5000 stars we can suggest it for inclusion in DevDocs

@DrSensor: @Gabriel439 just made me aware of this document:

https://github.com/dhall-lang/dhall-lang/blob/master/standard/multiline.md

It might be interesting for you too!

Was this page helpful?
0 / 5 - 0 ratings