mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
1576a578a0
* contrib library unused import removal * remove a few unused imports. * another round of unused import removal * another round of unused import deletion. * another round of unused import deletion.
20 lines
659 B
Idris
20 lines
659 B
Idris
module Prelude.Interpolation
|
|
|
|
||| Interpolated strings are of the form `"xxxx \{ expr } yyyy"`.
|
|
||| In this example the string `"xxxx "` is concatenated with `expr` and
|
|
||| `" yyyy"`, since `expr` is not necessarily a string, the generated
|
|
||| code looks like this:
|
|
||| ```
|
|
||| concat [interpolate "xxxx ", interpolate expr, interpolate " yyyy"]
|
|
||| ```
|
|
||| This allows to customise the interpolation behaviour by providing
|
|
||| an instance of `Interpolation` for a type.
|
|
public export
|
|
interface Interpolation a where
|
|
interpolate : a -> String
|
|
|
|
||| The interpolation instance for Strings is the identity
|
|
export
|
|
Interpolation String where
|
|
interpolate x = x
|