-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Debugging by observing in place -- -- Hood debugger, based on the idea of observing functions and structures -- as they are evaluated. @package hood @version 0.2 module Debug.Hood.Observe -- | observe observes data structures in flight. -- -- An example of use is map (+1) . observe "intermeduate" . map (+2) -- -- -- In this example, we observe the value that flows from the producer -- map (+2) to the consumer map (+1). -- -- observe can also observe functions as well a structural values. observe :: Observable a => String -> a -> a newtype Observer O :: (forall a. Observable a => String -> a -> a) -> Observer type Observing a = a -> a class Observable a observer :: Observable a => a -> Parent -> a observers :: Observable a => String -> (Observer -> a) -> a -- | The main entry point; run some IO code, and debug inside it. -- -- An example of using this debugger is -- --
--   runO (print [ observe +1 (+1) x | x <- observe xs [1..3]])
--   
-- --
--   [2,3,4]
--    -- +1
--     {  1  -> 2
--     }
--    -- +1
--     {  2  -> 3
--     }
--    -- +1
--     {  3  -> 4
--     }
--    -- xs
--     1 : 2 : 3 : []
--   
-- -- Which says, the return is [2,3,4], there were 3 -- calls to +1 (showing arguments and results), and xs, which -- was the list 1 : 2 : 3 : []. runO :: IO a -> IO () -- | print a value, with debugging printO :: Show a => a -> IO () -- | print a string, with debugging putStrO :: String -> IO () (<<) :: Observable a => ObserverM (a -> b) -> a -> ObserverM b thunk :: Observable a => a -> ObserverM a send :: String -> ObserverM a -> Parent -> a observeBase :: Show a => a -> Parent -> a observeOpaque :: String -> a -> Parent -> a -- | run some code and return the CDS structure (for when you want to write -- your own debugger). debugO :: IO a -> IO [CDS] data CDS CDSNamed :: String -> CDSSet -> CDS CDSCons :: Int -> String -> [CDSSet] -> CDS CDSFun :: Int -> CDSSet -> CDSSet -> CDS CDSEntered :: Int -> CDS instance Show Doc instance Eq Doc instance Eq DOC instance Show DOC instance Eq Output instance Ord Output instance Show CDS instance Eq CDS instance Ord CDS instance Show Change instance Show Event instance Show Parent instance Monad ObserverM instance Observable Dynamic instance Observable SomeException instance (Observable a, Observable b) => Observable (a -> b) instance Observable a => Observable (IO a) instance (Ix a, Observable a, Observable b) => Observable (Array a b) instance (Observable a, Observable b) => Observable (Either a b) instance Observable a => Observable (Maybe a) instance Observable a => Observable [a] instance (Observable a, Observable b, Observable c, Observable d, Observable e) => Observable (a, b, c, d, e) instance (Observable a, Observable b, Observable c, Observable d) => Observable (a, b, c, d) instance (Observable a, Observable b, Observable c) => Observable (a, b, c) instance (Observable a, Observable b) => Observable (a, b) instance Observable () instance Observable Char instance Observable Double instance Observable Float instance Observable Integer instance Observable Bool instance Observable Int