Hoed-0.1.0.0: Debug anything without recomping everything!

Safe HaskellNone

Debug.Hoed.Observe

Contents

Synopsis

The main Hood API

newtype Observer Source

Constructors

O (forall a. Observable a => String -> a -> a) 

runO :: IO a -> IO ()Source

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 : [].

printO :: Show a => a -> IO ()Source

print a value, with debugging

putStrO :: String -> IO ()Source

print a string, with debugging

For advanced users, that want to render their own datatypes.

(<<) :: Observable a => ObserverM (a -> b) -> a -> ObserverM bSource

thunk :: (a -> Parent -> a) -> a -> ObserverM aSource

nothunk :: a -> ObserverM aSource

send :: String -> ObserverM a -> Parent -> aSource

observeBase :: Show a => a -> Parent -> aSource

observeOpaque :: String -> a -> Parent -> aSource

For users that want to write there own render drivers.

debugO :: IO a -> IO [CDS]Source

run some code and return the CDS structure (for when you want to write your own debugger).

data CDS Source

Constructors

CDSNamed String CDSSet 
CDSCons Int String [CDSSet] 
CDSFun Int CDSSet CDSSet 
CDSEntered Int 
CDSTerminated Int 

Instances

class Generic a

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

Instances

Generic Bool 
Generic Char 
Generic Double 
Generic Float 
Generic Int 
Generic Ordering 
Generic () 
Generic [a] 
Generic (Maybe a) 
Generic (Either a b) 
Generic (a, b) 
Generic (a, b, c) 
Generic (a, b, c, d) 
Generic (a, b, c, d, e) 
Generic (a, b, c, d, e, f) 
Generic (a, b, c, d, e, f, g)