qm-interpolated-string-0.3.0.0: Implementation of interpolated multiline strings

Safe HaskellNone
LanguageHaskell98

Text.InterpolatedString.QM

Synopsis

Documentation

qm :: QuasiQuoter Source #

QuasiQuoter for multiline interpolated string.

[qm| foo {'b':'a':'r':""}
   \ baz |] -- "foo bar baz"

Symbols that could be escaped:

  • \ - backslash itself (two backslashes one by one: \\) [qm| foo\\bar |] -- "foo\\bar"
  • Space symbol at the edge (to put it to the output instead of just ignoring it) [qm| foo\ |] -- "foo " or [qm|\ foo |] -- " foo"
  • Line break \n (actual line breaks are ignored)
  • Opening bracket of interpolation block \{ to prevent interpolation and put it as it is [qm| {1+2} \{3+4} |] -- "3 {3+4}"

qn :: QuasiQuoter Source #

Works just like qm but without interpolation (just multiline string with decorative indentation).

[qn| foo {'b':'a':'r':""}
   \ baz |] -- "foo {'b':'a':'r':\"\"} baz"

Interpolation blocks goes just as text:

[qn| {1+2} \{3+4} |] -- "{1+2} \\{3+4}"

qmb :: QuasiQuoter Source #

qm + b (line-Breaks)

[qmb| foo
      {'b':'a':'r':""}
      baz |] -- "foo\nbar\nbaz"

Keep in mind that this example:

[qmb|
  foo
  bar
|]

Won't produce "foo\nbar\n" nor "\nfor\nbar\n" but "foo\nbar", it means it separates "between" the lines not by edges.

qnb :: QuasiQuoter Source #

qn + b (line-Breaks) Works just like qmb but without interpolation.

[qnb| foo
      {'b':'a':'r':""}
      baz |] -- "foo\n{'b':'a':'r':\"\"}\nbaz"

Keep in mind that this example:

[qnb|
  foo
  bar
|]

Won't produce "foo\nbar\n" nor "\nfor\nbar\n" but "foo\nbar", it means it separates "between" the lines not by edges.

qms :: QuasiQuoter Source #

qm + s (Spaces)

[qms| foo
      {'b':'a':'r':""}
      baz |] -- "foo bar baz"

Keep in mind that this example:

[qms|
  foo
  bar
|]

Won't produce "foo bar " nor " for bar " but "foo bar", it means it separates "between" the lines not by edges.

qns :: QuasiQuoter Source #

qn + s (Spaces)

Works just like qms but without interpolation.

[qns| foo
      {'b':'a':'r':""}
      baz |] -- "foo {'b':'a':'r':\"\"} baz"

Keep in mind that this example:

[qns|
  foo
  bar
|]

Won't produce "foo bar " nor " for bar " but "foo bar", it means it separates "between" the lines not by edges.

class ShowQ a where Source #

Minimal complete definition

showQ

Methods

showQ :: a -> String Source #