Hi fellow debaters,
>I hope you've had fun with all the MonadZero mail.
I surely did.
>My conclusion: we should combine Monad and MonadZero.
>Sorry Erik, but you are now the lone voice in the wilderness.
Don't worry, I am used to that :-)
>Here's a concrete proposal:
>
>That's it! Comments?
Looks ok to me, only I would write the translation of do as
do{ p <- e; stmts } =
e >>= \x ->
case x of
{ p -> do{ stmts }
; _ -> mfail "....."
}
>Simon
Some remarks about
http://research.microsoft.com/Users/simonpj/Haskell/haskell98-final.html
* I don't understand unfoldr! The proposed definition is
unfoldr :: (a -> Maybe (b,a)) -> a -> (a,[b])
unfoldr f = g where
g = \a ->
case f a of
{ Nothing -> (a,[])
; Just (b,a') -> let (a'',bs) = g a' in (a'',b:bs)
}
But note that in general unfold is used to build *infinite* lists. Pulling
on the fst of the resulting pair therefore leads to disaster in most cases.
ones = unfoldr (\a -> Just (1,a)) 17
Why the extra generality? Why not use the normal unfold from Bird and Wadler
and from Geremy's and Graham's papers from this year's ICFP?
* What will be the fixity and precedence of ($!), the same as ($) I guess.
* Let's leave the default default.
* Let's give type variables in head position the benefit of the doubt. Given
the pre-constructor class restrictions of Haskell, this *feels* like the
right generalization.
* The sentence "Section 5.4.2. Name clashes only cause an error if the
offending name is actually mentioned.now a" ends strangely.
* You probably already know this: "Section ??. Class declarations can
contain intermingled type signatures, fixity declarations, and value
declarations for default class methods. "
I must admit that I had my doubts about the whole Haskell98 adventure, but
in the end I do believe that the language has been refreshed and improved.
Erik
PS
Has anybody read the "anti-patterns" book (is a joke, or is it serious?),
and heard about the name change of NT5 to Windows2000 (very smart way of
creating an extra year of slack). Perhaps Haskell98 is not such a cool name
after all :-)