Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
Function types operating over the DrawingContext as a static argument.
- data CF a
- type Query a = CF a
- runCF :: DrawingContext -> CF a -> a
- consCF :: (DrawingContext -> a) -> CF a
- domMap1 :: (r1 -> r1) -> CF (r1 -> a) -> CF (r1 -> a)
- domMap2 :: (r1 -> r1) -> (r2 -> r2) -> CF (r1 -> r2 -> a) -> CF (r1 -> r2 -> a)
- promoteR1 :: (r1 -> CF a) -> CF (r1 -> a)
- promoteR2 :: (r1 -> r2 -> CF a) -> CF (r1 -> r2 -> a)
- pushR0 :: (a -> a1) -> CF a -> CF a1
- pushR1 :: (a -> a1) -> CF (r1 -> a) -> CF (r1 -> a1)
- pushR2 :: (a -> a1) -> CF (r1 -> r2 -> a) -> CF (r1 -> r2 -> a1)
- apply1R1 :: CF (r1 -> a) -> r1 -> CF a
- apply1R2 :: CF (r1 -> r2 -> a) -> r2 -> CF (r1 -> a)
- apply2R2 :: CF (r1 -> r2 -> a) -> r1 -> r2 -> CF a
- lift0R1 :: CF a -> CF (r1 -> a)
- lift0R2 :: CF a -> CF (r1 -> r2 -> a)
- lift1R2 :: CF (r1 -> a) -> CF (r1 -> r2 -> a)
- uconvR0 :: (FontSize -> ans -> ans1) -> CF ans -> CF ans1
- uconvR1 :: (Functor t, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t u -> ans) -> CF (t u1 -> ans1)
- uconvR2a :: (Functor t, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t u -> r2 -> ans) -> CF (t u1 -> r2 -> ans1)
- uconvR2ab :: (Functor t1, Functor t2, InterpretUnit u, InterpretUnit u1) => (FontSize -> ans -> ans1) -> CF (t1 u -> t2 u -> ans) -> CF (t1 u1 -> t2 u1 -> ans1)
- drawingCtx :: Query DrawingContext
Context functional type
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
Alias
Run function
runCF :: DrawingContext -> CF a -> aSource
Run a CF (context function) with the supplied DrawingContext.
Construction
consCF :: (DrawingContext -> a) -> CF aSource
Construction function.
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
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)