On 05/01/06, Taral <[EMAIL PROTECTED]> wrote:
> On 1/5/06, Cale Gibbard <[EMAIL PROTECTED]> wrote:
> > class Applicative m => Monad m where
> > m >>= f = join (map f m)
> >
> > instance PointedFunctor m where
> > require return
> > map f x = x >>= (return . f)
>
> Um, it looks like map and (>>=) are recursive...
>
The intent is that this is similar to other default method
declarations which aren't really recursive, though they may look like
it.
>From the Ord class in the Prelude, we have:
compare x y
| x == y = EQ
| x <= y = LT
| otherwise = GT
x <= y = compare x y /= GT
....
Which looks recursive, but it's not, because the user is required to
provide one of the two.
- Cale
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell