[Haskell-cafe] Multiparameter class error
Alfonso Acosta
alfonso.acosta at gmail.com
Wed Feb 21 08:00:39 EST 2007
Hi,
I'm a newbie to multiparameter classes and I'm getting this error from
GHC when compiling the following class definition:
Could not deduce (Synchronous s f11)
from the context (Synchronous s f1)
arising from use of `delaySY'
Possible fix:
add (Synchronous s f11) to the class or instance method `sourceSY'
In the expression: delaySY s0 s
In the definition of `o': o = delaySY s0 s
In the definition of `sourceSY':
sourceSY f s0
= o
where
o = delaySY s0 s
s = mapSY f
\begin{code}
class Synchronous s f1 where
mapSY :: f1 a b -> s a -> s b
delaySY :: a -> s a -> s a
sourceSY :: f1 a a -> a -> s a
sourceSY f s0 = o
where
o = delaySY s0 s
s = mapSY f o
\end{code}
Can anyone explain a bit further than GHC what am I doing wrong?
Thanks,
Alfonso Acosta
More information about the Haskell-Cafe
mailing list