GHood-0.0.5: A graphical viewer for Hood

CopyrightLicense : BSD3
Safe HaskellNone




GHood: A graphical viewer for Hood

Created a cabal library package. Improved the search for the GHood.jar file, that is bundled with the library. Changed from Literate Haskell to plain Haskell for better haddock documentation support.

Hugo Pacheco, November 2008

Added ObserveM. Adapted imports to use GHC's hierarchical libraries.

Alcino Cunha, February 2004

Modified version of Hood/Observe.lhs to match GHood, the Graphical Haskell Object Observation Debugger, which is distributed as a Java class file archive GHood.jar. [Apart from two new hooks, modifications are at the end]

Claus Reinke, December 2000

The file is part of the Haskell Object Observation Debugger, (HOOD) July 2000 release. Actually this is all of this version of HOOD, apart from the documentation and examples...

HOOD is a small post-mortem debugger for the lazy functional language Haskell. It is based on the concept of observation of intermediate data structures, rather than the more traditional stepping and variable examination paradigm used by imperative language debuggers.

Copyright (c) Andy Gill, 1992-2000



observe :: Observable a => String -> a -> a Source

Our principle function and class

newtype Observer Source

Contains a forall typed observe (if supported).


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

type Observing a = a -> a Source

class Observable a where Source

Minimal complete definition



observer :: a -> Parent -> a Source

This reveals the name of a specific constructor. and gets ready to explain the sub-components. We put the context second so we can do eta-reduction with some of our definitions.

observers :: String -> (Observer -> a) -> a Source

This used used to group several observer instances together.

runO :: IO a -> IO () Source

Runs observe ridden code.

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

Runs and prints observe ridden code.

putStrO :: String -> IO () Source

Prints a string during observation.

newtype ObserverM a Source

A simple state monad for placing numbers on sub-observations.




runMO :: Int -> Int -> (a, Int)

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

(<<) :: Observable a => ObserverM (a -> b) -> a -> ObserverM b infixl 9 Source

the infix (<<) is a shortcut for constructor arguments.

thunk :: Observable a => a -> ObserverM a Source

thunk is for marking suspensions.

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

Sends a packet to the observation agent.

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

The strictness (by using seq) is the same as the pattern matching done on other constructors. We evaluate to WHNF, and not further.

Observe a base type

observeOpaque :: String -> a -> Parent -> a Source

Observe a base type as an opaque string.

data Parent Source

Parent book-keeping information.




observeParent :: !Int

my parent

observePort :: !Int

my branch number


For users that want to write their own render drivers.

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

Debugs observe ridden code.

type CDSSet = [CDS] Source