HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulestreamly-core-0.3.1Haskell2010

Streamly.Internal.Unicode.String

Convenient template Haskell quasiquoters to format strings.

Contents
  1. Setup
Synopsis

Setup

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