syntactic-0.3: Generic abstract syntax, and utilities for embedded languages

Language.Syntactic.Features.PrimFunc

Description

Primitive functions

Synopsis

Documentation

primFunc1 :: (Typeable a, PrimFunc :<: dom) => String -> (a -> b) -> ASTF dom a -> ASTF dom bSource

primFunc2 :: (Typeable a, Typeable b, PrimFunc :<: dom) => String -> (a -> b -> c) -> ASTF dom a -> ASTF dom b -> ASTF dom cSource

primFunc3 :: (Typeable a, Typeable b, Typeable c, PrimFunc :<: dom) => String -> (a -> b -> c -> d) -> ASTF dom a -> ASTF dom b -> ASTF dom c -> ASTF dom dSource

primFunc4 :: (Typeable a, Typeable b, Typeable c, Typeable d, PrimFunc :<: dom) => String -> (a -> b -> c -> d -> e) -> ASTF dom a -> ASTF dom b -> ASTF dom c -> ASTF dom d -> ASTF dom eSource

primFuncAnn1 :: (Typeable a, PrimFunc :<: dom) => String -> (a -> b) -> info b -> AnnSTF info dom a -> AnnSTF info dom bSource

primFuncAnn2 :: (Typeable a, Typeable b, PrimFunc :<: dom) => String -> (a -> b -> c) -> info c -> AnnSTF info dom a -> AnnSTF info dom b -> AnnSTF info dom cSource

primFuncAnn3 :: (Typeable a, Typeable b, Typeable c, PrimFunc :<: dom) => String -> (a -> b -> c -> d) -> info d -> AnnSTF info dom a -> AnnSTF info dom b -> AnnSTF info dom c -> AnnSTF info dom dSource

primFuncAnn4 :: (Typeable a, Typeable b, Typeable c, Typeable d, PrimFunc :<: dom) => String -> (a -> b -> c -> d -> e) -> info e -> AnnSTF info dom a -> AnnSTF info dom b -> AnnSTF info dom c -> AnnSTF info dom d -> AnnSTF info dom eSource

class IsFunction expr whereSource

Class of expressions that can be treated as primitive functions

Methods

toFunction :: expr a -> PrimFunc aSource

exprEqFunc :: IsFunction expr => expr a -> expr b -> BoolSource

Default implementation of exprEq

renderPartFunc :: IsFunction expr => [String] -> expr a -> StringSource

Default implementation of renderPart

evaluateFunc :: IsFunction expr => expr a -> aSource

Default implementation of evaluate

exprHashFunc :: IsFunction expr => expr a -> HashSource

Default implementation of exprHash