serokell / nyan-interpolation

Flexible and extensible interpolation for Haskell
Mozilla Public License 2.0
4 stars 2 forks source link

Nyan-interpolation

License: MPL 2.0 GitHub CI

nyan-interpolation nyan-interpolation-core nyan-interpolation-simple

Flexible production-scale string interpolation library.

Motivation

We wanted a solution that would

How To Use

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.

Packages

This repository contains the following haskell packages:

IDE Integration

VSCode

We provide snippets, and syntax highlighting is yet to be implemented (see #3).

For Contributors

Please see CONTRIBUTING.md for more information.

About Serokell

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!