Trying to make Hood work with GHC

Alain Cremieux alcremi@pobox.com
Wed, 25 Jul 2001 14:10:58 +0200


Hi,
I'm currently trying to have Hood work with GHC, but I have some
problems
- I have succeeded in using the hugs version of Hood
- I have dowloaded the GHC version (slightly different) but the
compilation of the 'Observe' modules fails (the module is supposed to
work with GHC 4.08 and I have GHC 5.00.2) :

Duplicate instance declarations:
  Observe.lhs:272: Observable IOError
  Observe.lhs:291: Observable Exception

with the following command-line :
ghc -fglasgow-exts -package lang -package concurrent Observe.lhs

corresponding to the source :

instance Observable IOError  where { observer = observeBase }

instance Observable Exception where
  observer (IOException a)      = send "IOException" (return IOException
<< a)
  observer (ErrorCall a)        = send "ErrorCall"   (return ErrorCall
<< a)
  observer other                = send "<Exception>" (return other)


I don't understant why there are duplicate instance declarations.
Furthermore, removing them leads to :

Observe.lhs:182:
    No instance for `Observable Exception'
    arising from use of `<<' at Observe.lhs:182
    In the second argument of `send', namely `((return throw) << exc)'
    In the first argument of `return', namely
        `(send "throw" ((return throw) << exc) context)'

Changing names (of Observable...) does not help, so its is not a name
conflict with prelude or libraries


The source is avalaible at :
http://haskell.cs.yale.edu/hood/downloads/ghc/Observe.lhs
(I don't include it here so the M.L. won't be cluttered)

If somebody can help, I am completely at a loss

Alain