HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulestreamly-core-0.2.2Haskell2010

Streamly.Internal.Unicode.String

Convenient template Haskell quasiquoters to format strings.

  • 1 value

Setup

1 declaration

To execute the code examples provided in this module in ghci, please run the following commands first.

Example3 expressions
:m:set -XQuasiQuotesimport Streamly.Internal.Unicode.String
valuestr :: QuasiQuoter
#

A QuasiQuoter that treats the input as a string literal:

Example1 expression
[str|x|]"x"

Any #{symbol} is replaced by the value of the Haskell symbol symbol which is in scope:

Example2 expressions
x = "hello"[str|#{x} world!|]"hello world!"

## means a literal # without the special meaning for referencing haskell symbols:

Example1 expression
[str|##{x} world!|]"#{x} world!"

A # at the end of line means the line continues to the next line without introducing a newline character:

Example1 expression
:{[str|hello#world!|]:}"hello world!"

Bugs: because of a bug in parsers, a lone # at the end of input gets removed.