Am Mittwoch, 26. Juli 2006 16:20 schrieb Dmitri O.Kondratiev:
> On 7/25/06, Jared Updike <[EMAIL PROTECTED]> wrote:
> > > I am trying to derive MyOrd class from Eq (Prelude):
> > >
> > > class Eq a => MyOrd a where
> > > (%<=), (%>), (%>=) :: a -> a -> Bool
> > > x %<= y = (x < y ||
Hi Dmitri,
I don't have answers for all your questions. But some, at least.
--- Dmitri O.Kondratiev" <[EMAIL PROTECTED] wrote:
> -- Ok, then I can
derive MyOrd class directly from Ord:
>
> class Ord a => MyOrd a where
> (%<), (%<=), (%>), (%>=) :: a -> a -> Bool
> x %< y = x < y
>
On 7/25/06, Jared Updike <[EMAIL PROTECTED]> wrote:
> I am trying to derive MyOrd class from Eq (Prelude):
>
> class Eq a => MyOrd a where
> (%<=), (%>), (%>=) :: a -> a -> Bool
> x %<= y = (x < y || x == y)
> x %> y = y < x
> x %>= y = (y < x || x == y)
>
> Q: Wh
sage-
> From: [EMAIL PROTECTED] [mailto:haskell-cafe-
> [EMAIL PROTECTED] On Behalf Of Bulat Ziganshin
> Sent: Tuesday, July 25, 2006 9:46 AM
> To: Dmitri O.Kondratiev
> Cc: haskell-cafe@haskell.org
> Subject: Re: [Haskell-cafe] Newbie Q: Deriving MyOrd from Eq problem
>
> Hello
Hello Dmitri,
Tuesday, July 25, 2006, 8:15:41 PM, you wrote:
> class Eq a => MyOrd a where
> (%<=), (%>), (%>=) :: a -> a -> Bool
> x %<= y = (x < y || x == y)
> x %> y = y < x
> x %>= y = (y < x || x == y)
you are mixing definition of class and its (default) ins
Sorry, left out an important verb, *hide*:
You can the prelude and thus the Ord class and make your own < and >
You can *hide* the prelude and thus the Ord class and make your own < and >
Jared.
--
http://www.updike.org/~jared/
reverse ")-:"
___
Ha
I am trying to derive MyOrd class from Eq (Prelude):
class Eq a => MyOrd a where
(%<=), (%>), (%>=) :: a -> a -> Bool
x %<= y = (x < y || x == y)
x %> y = y < x
x %>= y = (y < x || x == y)
Q: What's wrong? Why 'Ord' gets into play here?
You are using < which i