wumpus-basic-0.17.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Base.ContextFun

Contents

Description

Function types operating over the DrawingContext as a static argument.

Synopsis

Context functional type

data CF a Source

Most drawing operations in Wumpus-Basic have an implicit graphics state the DrawingContext, so the most primitive building block is a function from the DrawingContext to some polymorphic answer.

This functional type is represented concretely as the initials CF for contextual function.

 CF :: DrawingContext -> a 

Instances

Alias

type Query a = CF aSource

Alias for CF. Wumpus considers Context functions that don't produce graphics to be queries.

 Query :: DrawingContext -> a 

Query has no unit type parameter.

Run function

runCF :: DrawingContext -> CF a -> aSource

Run a CF (context function) with the supplied DrawingContext.

Construction

consCF :: (DrawingContext -> a) -> CF aSource

Construction function.

domMap1 :: (r1 -> r1) -> CF (r1 -> a) -> CF (r1 -> a)Source

domMap2 :: (r1 -> r1) -> (r2 -> r2) -> CF (r1 -> r2 -> a) -> CF (r1 -> r2 -> a)Source

promoteR1 :: (r1 -> CF a) -> CF (r1 -> a)Source

promoteR2 :: (r1 -> r2 -> CF a) -> CF (r1 -> r2 -> a)Source

pushR0 :: (a -> a1) -> CF a -> CF a1Source

Apply the value transformer to the answer of the context function. Figuratively push it right so it works on the answer.

 pushR0 = fmap

pushR1 :: (a -> a1) -> CF (r1 -> a) -> CF (r1 -> a1)Source

Apply the value transformer to the answer of the context function. Figuratively push it right so it works on the answer.

 pushR1 = fmap . fmap

pushR2 :: (a -> a1) -> CF (r1 -> r2 -> a) -> CF (r1 -> r2 -> a1)Source

Apply the value transformer to the answer of the context function. Figuratively push it right so it works on the answer.

 pushR2 = fmap . fmap . fmap 

apply1R1 :: CF (r1 -> a) -> r1 -> CF aSource

apply1R2 :: CF (r1 -> r2 -> a) -> r2 -> CF (r1 -> a)Source

apply2R2 :: CF (r1 -> r2 -> a) -> r1 -> r2 -> CF aSource

lift0R1 :: CF a -> CF (r1 -> a)Source

lift0R2 :: CF a -> CF (r1 -> r2 -> a)Source

lift1R2 :: CF (r1 -> a) -> CF (r1 -> r2 -> a)Source

uconvR0 :: (FontSize -> ans -> ans1) -> CF ans -> CF ans1Source

uconvR1 :: (Functor t, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t u -> ans) -> CF (t u1 -> ans1)Source

uconvR2a :: (Functor t, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t u -> r2 -> ans) -> CF (t u1 -> r2 -> ans1)Source

uconvR2ab :: (Functor t1, Functor t2, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t1 u -> t2 u -> ans) -> CF (t1 u1 -> t2 u1 -> ans1)Source

drawingCtx :: Query DrawingContextSource

Extract the drawing context from a CtxFun.

 (ctx -> ctx)