Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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.