ap-reflect-0.1.0.0: Partial evaluation reflection a la simple-reflect.

Safe HaskellSafe-Inferred

Debug.Reflect

Synopsis

Documentation

data a (~>) b Source

analog of (->)

Constructors

Fn String (a -> b)

name and function itself

Instances

Functor (~> a) 
Show (~> a b) 

fromFn :: (a ~> b) -> a -> bSource

gets function

parens :: String -> StringSource

adds brackets

isInfixFn :: String -> BoolSource

checks whether function is infix

showFn :: String -> String -> StringSource

shows function with its argument

makeFn2 :: Show a => String -> (a -> b -> c) -> a ~> (b ~> c)Source

translates function (a -> b -> c) into (a ~> b ~> c)

makeBinOp :: Show a => String -> (a -> b -> c) -> a ~> (b ~> c)Source

makes binary operation

data Ap b Source

reflected expression

Constructors

Val b 
forall a . Show a => (Ap (a ~> b)) :$ (Ap a) 

Instances

Show a => Show (Ap a) 

isVal :: Ap a -> BoolSource

checks whether expression is Val

balanceParens :: String -> StringSource

balances brackets

parensFr :: String -> StringSource

balances brackets

showOp :: String -> String -> String -> StringSource

shows operation application

showF :: String -> String -> StringSource

shows operation application

fmap' :: Functor f => (a ~> b) ~> (f a ~> f b)Source

analog of fmap using (~>)

pure' :: Applicative f => a ~> f aSource

analog of pure using (~>)

ap' :: (Show (f (a ~> b)), Applicative f) => f (a ~> b) ~> (f a ~> f b)Source

analog of <*> using (~>)

(-$-) :: (Show (f a), Functor f) => (a ~> b) -> f a -> Ap (f b)Source

analog of <$>

(-*-) :: (Show (f (a ~> b)), Show (f a), Applicative f) => Ap (f (a ~> b)) -> f a -> Ap (f b)Source

analog of <*>

pure'' :: (Show a, Applicative f) => a -> Ap (f a)Source

analog of pure

fmap'' :: (Show (f a), Functor f) => (a ~> b) -> f a -> Ap (f b)Source

analog of fmap

reduce'' :: Ap a -> Ap aSource

reduces an expression

reduce' :: Show a => Ap a -> Ap aSource

reduces (evaluates) an expression once

reductions :: Show a => Ap a -> [Ap a]Source

gets all reduction steps when evaluating an expression