Flexible production-scale string interpolation library.
We wanted a solution that would
Buildable
and FromBuildable
by default, but would allow using Show
if necessary too.haskell-src-exts
dependency;Show
as default;The usage looks like:
import Text.Interpolation.Nyan
myText :: Text
myText =
let val = 5 :: Int
[int|s| Value is #{val} |]
-- "Value is 5"
myMultilineText :: Text
myMultilineText =
[int||
What would you get if you fix a cat and a rainbow?
And a cookie?
|]
-- "What would you get if you fix a cat and a rainbow?\nAnd a cockie?\n"
The full introduction can be found in the haddock documentation.
This repository contains the following haskell packages:
full
contains the basic interpolator and corresponds to the nyan-interpolation
library;core
provides means for defining custom interpolators and corresponds to the nyan-interpolation-core
library;simple
contains the lightweight interpolator and corresponds to the nyan-interpolation-simple
library.We provide snippets, and syntax highlighting is yet to be implemented (see #3).
Please see CONTRIBUTING.md for more information.
Nyan-interpolation is maintained and funded with ❤️ by Serokell. The names and logo for Serokell are trademark of Serokell OÜ.
We love open source software! See our other projects or hire us to design, develop and grow your idea!