Hugs version: 1.3c
Configuration options: nothing special
OS: Sun 5 & Windows NT
Compiler: gcc & N/A respectively

Expected behavior: Expected the type class to be accepted.
This example was posted to comp.lang.functional by Sigbjorn Finne
on March 30, as an example of how Haskell multi-parameter type classes
would be used.  I had tried something similar earlier the same day,
without success.  So I tried the posted example, and got the same
kind of failure.

Observed behavior: Hugs reported error.

Session transcript:
Reading script file "\hugs\prelude.hs":

Hugs session for:
\hugs\prelude.hs
Type :? for help
? :l bug1.hs
Reading script file "bug1.hs":

ERROR "bug1.hs" (line 5): Ambiguous type signature in class declaration
*** ambiguous type : Stream a b => a c -> c -> IO ()
*** assigned to    : write

Related programs: bug1.hs:
data Priority = Pri

class Stream source sink where
   makeStream :: Priority -> (source a, sink a)
   write      :: source a -> a -> IO ()
   read       :: sink a -> IO a
   pipe       :: source a -> sink a -> IO ()     -- never returns

--
Scott Turner
[EMAIL PROTECTED]       http://www.ma.ultranet.com/~pkturner

Reply via email to