template-haskell-natural-1.0.0.0
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.Natural.Syntax.Func

Description

Builder for top-level function declaration

Synopsis

Builder

newFunc :: forall (step :: BuilderStep). String -> FuncBuilder step 'Ready () -> Q [Dec] Source #

Builds a function declaration. The string argument is the name of the function

State

data FuncBuilderState Source #

Constructors

MkFBS 

Functions

Clause

addClause :: forall (step :: BuilderStep). Clause -> FuncBuilder step 'Ready () Source #

Add a clause to the function

bodyFromExp :: forall b (step :: BuilderStep). GenExpr b => b -> FuncBuilder step 'Ready () Source #

Uses an Exp as the body of a function

Warning: This operation is destructive, and replaces all previous clauses set using addClause

Signature

setSignature :: forall {k} a (step :: k). GenType a => a -> FuncBuilder step step () Source #

Set the signature of the function

Pragmas

inline :: forall {k} (step :: k). FuncBuilder step step () Source #

Add an inline pragma to the function

setInline :: forall {k} (step :: k). Inline -> RuleMatch -> Phases -> FuncBuilder step step () Source #

Sets an inline pragma to the function

addPragma :: forall {k} (step :: k). Pragma -> FuncBuilder step step () Source #

Add a Pragma alongside the function declaration

Lenses

Reexports