ede-0.3.4.0: Templating language with similar syntax and features to Liquid or Jinja2.
Copyright(c) 2013-2022 Brendan Hay <brendan.g.hay@gmail.com>
LicenseThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. A copy of the MPL can be found in the LICENSE file or you can obtain it at http://mozilla.org/MPL/2.0/.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.EDE.Internal.Quoting

Description

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!

Synopsis

Documentation

data Term Source #

A HOAS representation of (possibly partially applied) values in the environment.

Constructors

TVal !Value 
TLam (Term -> Result Term) 

Instances

Instances details
Quote Term Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Term -> Term Source #

AnsiPretty Term Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

apretty :: Term -> AnsiDoc Source #

qapply :: Delta -> Term -> Term -> Result Term Source #

Fully apply two Terms.

qprim :: (ToJSON a, Quote a) => a -> Term Source #

Quote a primitive Value from the top-level.

class Unquote a where Source #

Minimal complete definition

Nothing

Methods

unquote :: Id -> Int -> Term -> Result a Source #

default unquote :: FromJSON a => Id -> Int -> Term -> Result a Source #

Instances

Instances details
Unquote Value Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Value Source #

Unquote Collection Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Collection Source #

Unquote Scientific Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Scientific Source #

Unquote Text Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Text Source #

Unquote Text Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Text Source #

Unquote Integer Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Integer Source #

Unquote Bool Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Bool Source #

Unquote Double Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Double Source #

Unquote Int Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result Int Source #

Unquote (KeyMap Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result (KeyMap Value) Source #

Unquote (Vector Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result (Vector Value) Source #

Unquote [Text] Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result [Text] Source #

Unquote (HashMap Text Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

unquote :: Id -> Int -> Term -> Result (HashMap Text Value) Source #

class Quote a where Source #

Minimal complete definition

Nothing

Methods

quote :: Id -> Int -> a -> Term Source #

default quote :: ToJSON a => Id -> Int -> a -> Term Source #

Instances

Instances details
Quote Value Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Value -> Term Source #

Quote Term Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Term -> Term Source #

Quote Scientific Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Scientific -> Term Source #

Quote Text Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Text -> Term Source #

Quote Builder Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Builder -> Term Source #

Quote Text Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Text -> Term Source #

Quote Integer Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Integer -> Term Source #

Quote Bool Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Bool -> Term Source #

Quote Double Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Double -> Term Source #

Quote Int Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Int -> Term Source #

Quote (KeyMap Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> KeyMap Value -> Term Source #

Quote (Vector Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> Vector Value -> Term Source #

Quote [Value] Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> [Value] -> Term Source #

Quote [Text] Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> [Text] -> Term Source #

Quote (HashMap Text Value) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> HashMap Text Value -> Term Source #

(Unquote a, Quote b) => Quote (a -> b) Source # 
Instance details

Defined in Text.EDE.Internal.Quoting

Methods

quote :: Id -> Int -> (a -> b) -> Term Source #

argumentErr :: Pretty a => Id -> Int -> a -> Result b Source #