HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulestreamly-core-0.3.1Haskell2010

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!"