I'm still stuck on this problem. Any hope for a bug fix? Any possible
work-around? - Conal
-----Original Message-----
From: Alastair Reid [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, October 21, 1998 6:23 PM
To: Conal Elliott; [EMAIL PROTECTED]
Subject: Re: Hugs type-checker bug?
[Metacomment to hugs-bugs folk.
We've finally restarted the outgoing mail queues on haskell.org -
so
bug reports and the like should now be flowing freely again.
That said, the message I'm replying to here didn't get through
properly -
I'm replying to some mail that bounced.
]
Hi Conal,
I had a quick look at this but can't figure out what's going wrong -
the
whole business of contexts on methods of superclasses is way too
subtle
for a simple haggis to comprehend. And that's before I try to think
about how Hugs' type system differs from Haskell ?.?'s type system.
Hopefully someone else out there can figure it out.
Alastair
I think I've stumbled across a type-checker bug, but I'm not sure.
I'm
really stumped, and would appreciate some help. - Conal
module Tst3 where
import Array
data Event a = Event
(.|.) :: Event a -> Event a -> Event a
_ .|. _ = Event
type Time = Double
data Behavior a = Behavior (Time -> a) (Event ())
at (Behavior f _) = f
invalE (Behavior _ e) = e
class GBehavior bv where
(!*) :: Ix ix => Array ix bv -> Behavior ix -> bv
instance GBehavior (Behavior a) where
(!*) = arrIndexB
instance GBehavior (Event a)
arrIndexB :: Ix ix => Array ix (Behavior c) -> Behavior ix ->
Behavior c
arr `arrIndexB` ixb =
Behavior (\t -> (arr ! (ixb `at` t)) `at` t)
(invalE ixb .|. (map invalE arr !* ixb))
-- Hugs says:
-- ERROR "c:/Users/Conal/NewFran/src/tst3.hs" (line 19):
Insufficient class
constraints in instance member binding
-- *** Context : ()
-- *** Required : Ix a
-- If I replace "map" by "undefined", there's no error message. I
think
-- this is a Hugs type checking bug, but I'm not sure. Line 19 is
the
-- body of the GBehavior (Behavior a) instance.