Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Safe HaskellNone

Derive.Call.StaticMacro

Description

A static macro is like a Derive.Call.Macro, except that its calls are given directly in haskell, instead of looked up as strings during evaluation. This means that the calls can't be rebound, but on the other hand, it can re-export the documentation for the sub-calls.

Synopsis

Documentation

data Call call Source #

Constructors

Call !call ![Arg] 

Instances

Show call => Show (Call call) # 

Methods

showsPrec :: Int -> Call call -> ShowS #

show :: Call call -> String #

showList :: [Call call] -> ShowS #

data Arg Source #

Constructors

Var 
Given !Term 

Instances

Show Arg # 

Methods

showsPrec :: Int -> Arg -> ShowS #

show :: Arg -> String #

showList :: [Arg] -> ShowS #

call :: ValCall -> [Arg] -> Arg Source #

check :: CallStack.Stack => Text -> Either Text a -> a Source #

Check the output of generator, transformer, or val and crash if it had a statically-detectable error. Of course I'd much rather this were a type error, but it's not worth breaking out TH for it.

generator :: Callable d => Module.Module -> CallName -> Tags.Tags -> Doc.Doc -> [Call (Transformer d)] -> Call (Generator d) -> Either Text (Generator d) Source #

Create a generator macro from a list of transformers and a generator.

transformer Source #

Arguments

:: Callable d 
=> Module.Module 
-> CallName 
-> Tags.Tags 
-> Doc.Doc 
-> [Call (Transformer d)]

Apply these transformers. This is in compose order, so the last one is applied first.

-> Either Text (Transformer d)