effective-aspects-0.1.0.0: A monadic embedding of aspect oriented programming

Safe HaskellNone

AOP.Internal.JoinpointModel

Synopsis

Documentation

Join points

data Jp m a b Source

Join points are function applications. We store the function and the argument, and the function type representation. | We add a FunctionTag value to use for quantification.

Constructors

(Typeable1Monad m, PolyTypeable (a -> m b)) => Jp (a -> m b) FunctionTag a TypeRep 

Instances

Typeable1 m => Typeable2 (Jp m)

Support for PolyTypeable

newjp :: (Typeable1Monad m, PolyTypeable (a -> m b)) => (a -> m b) -> FunctionTag -> a -> Jp m a bSource

Creates a join point with given function, tag, and argument

compareFun :: (Typeable1Monad m, PolyTypeable (a -> m b)) => t -> FunctionTag -> Jp m a b -> BoolSource

Comparing identity of functions:

compareType :: (Typeable1Monad m, PolyTypeable (a -> m b)) => TypeRep -> Jp m a b -> BoolSource

Compare types to see if type representation t is less general | than the type of the function associated to the join point

getJpArg :: Monad m => Jp m a b -> aSource

Gets the argument bound to the join point

data PC m a b Source

A pointcut is a predicate on the current join point. It is used to identify join points of interest.

Constructors

PC 

Fields

mpcond :: forall a' b'. m (Jp m a' b' -> m Bool)
 

Instances

runPC :: Monad m => PC m t t1 -> Jp m a' b' -> m BoolSource

Extracts the computation resulting of applying a join point to the pointcut

data RequirePC m a b Source

A RequirePC is not a valid standalone pointcut, it reflects a type requirement and must be combined with a standard PC.

Constructors

Typeable1Monad m => RequirePC 

Fields

mpcond' :: forall a' b'. m (Jp m a' b' -> m Bool)
 

Instances

type Advice m a b = (a -> m b) -> a -> m bSource

applyAdv :: Advice m a b -> t2 -> t2Source

Coerces t2 to be compatible with the advice. It passes t1 as a the proceed argument of the advice. This coercion is safe, as described in the paper.

data Aspect m a b c d Source

Typed first-class aspect. An aspect is tagged with a Unique value, used for identity

Constructors

LessGen (a -> b) (c -> m d) => Aspect (PC m a b) (Advice m c d) AspectHandle 

Instances

Show (Aspect m a b c d) 

aspect :: (Typeable1Monad m, LessGen (a1 -> b1) (a2 -> m b2)) => PC m a1 b1 -> Advice m a2 b2 -> Aspect m a1 b1 a2 b2Source

Constructs a well-typed aspect

deleteAsp :: Typeable1Monad m => EAspect m -> AspectEnv m -> AspectEnv mSource

Deletes asp from the aspect environment, used in undeploy

data EAspect m Source

Aspect with hidden types, to be used in the aspect environment

Constructors

forall a b c d . LessGen (a -> b) (c -> m d) => EAspect (Aspect m a b c d) 

Instances

Typeable1Monad m => Eq (EAspect m)

Notion of aspect equality to delete aspects from the aspect environment

Show (EAspect m) 

type AspectEnv m = [EAspect m]Source

Aspect environment