-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Partial evaluation reflection a la simple-reflect. -- @package ap-reflect @version 0.2 module Debug.Reflect -- | analog of (->) data (~>) a b -- | name and function itself Fn :: String -> (a -> b) -> (~>) a b -- | gets function fromFn :: (a ~> b) -> (a -> b) -- | adds brackets parens :: String -> String -- | checks whether function is infix isInfixFn :: String -> Bool -- | shows function with its argument showFn :: String -> String -> String -- | translates function (a -> b -> c) into (a ~> b -- ~> c) makeFn2 :: Show a => String -> (a -> b -> c) -> (a ~> (b ~> c)) -- | makes binary operation makeBinOp :: Show a => String -> (a -> b -> c) -> (a ~> (b ~> c)) -- | reflected expression data Ap b Val :: b -> Ap b (:$) :: Ap (a ~> b) -> Ap a -> Ap b -- | checks whether expression is Val isVal :: Ap a -> Bool -- | balances brackets balanceParens :: String -> String -- | balances brackets parensFr :: String -> String -- | shows operation application showOp :: String -> String -> String -> String -- | shows operation application showF :: String -> String -> String -- | analog of fmap using (~>) fmap' :: Functor f => (a ~> b) ~> (f a ~> f b) -- | analog of pure using (~>) pure' :: Applicative f => a ~> f a -- | analog of <*> using (~>) ap' :: (Show (f (a ~> b)), Applicative f) => f (a ~> b) ~> (f a ~> f b) -- | analog of <$> (-$-) :: (Show (f a), Functor f) => (a ~> b) -> f a -> Ap (f b) -- | analog of <*> (-*-) :: (Show (f (a ~> b)), Show (f a), Applicative f) => Ap (f (a ~> b)) -> f a -> Ap (f b) -- | analog of pure pure'' :: (Show a, Applicative f) => a -> Ap (f a) -- | analog of fmap fmap'' :: (Show (f a), Functor f) => (a ~> b) -> f a -> Ap (f b) -- | reduces an expression reduce'' :: Ap a -> Ap a -- | reduces (evaluates) an expression once reduce' :: Show a => Ap a -> Ap a -- | gets all reduction steps when evaluating an expression reductions :: Show a => Ap a -> [Ap a] instance Functor ((~>) a) instance Show a => Show (Ap a) instance Show (a ~> b)