Hi!
I am using the Win32 edition of hugs version January 1998.
There is a problem with the Maybe library. The problem occurs already in
the library report. On top of the page for the Maybe library it says that
unfoldr has type (a -> Maybe (b,a)) -> a -> (a,[b]) but the definition is
given like this:
unfoldr�f�x�=
��case�f�x�of
��Just�(x',y)�->�let�(ys,x'')�=�unfoldr�f�x'�in�(x'',y:ys)
��Nothing�����->�(x,[])
which gives the type ([a] -> Maybe ([a],a)) -> [a] -> ([a],[a]).
To get the general (and in my opinion correct, if one considers the
desired behavour of unfoldr) typesignature, the definition should look
like this:
unfoldr f x =
case f x of
Just (y,x')�->�let�(x'',ys)�=�unfoldr�f�x'�in�(x'',y:ys)
��Nothing�����->�(x,[])
Now, both hbc and ghc has this more general definition (at least according
to the interface files), so hugs should probably also have it.
This is really a bug in the library report but I don't know where to send
the bug report so maybe you could do something about it or at least tell
me where to send it.
Hugs is great, keep up the good works!
/Josef
----------------------------------------------------------
|Josef Svenningsson|http://www.dtek.chalmers.se/~d95josef|
|Rubingatan 39 | email: [EMAIL PROTECTED] |
|421 62 G�teborg | tel: 031-7090774 |
----------------------------------------------------------
What is a magician but a practising theorist?
-- Obi-Wan Kenobi