Re: Type::Class::Haskell does Role

2005-07-28 Thread TSa (Thomas Sandlaß)
HaloO Luke, you wrote: All in all, generic equality and comparison is something that Perl 5 did really poorly. Some people overloaded eq, some overloaded ==, some wrote a ->equal method, and there was no way to shift between the different paradigms smoothly. This is one of the times where we h

Re: The Use and Abuse of Liskov (was: Type::Class::Haskell does Role)

2005-07-27 Thread Luke Palmer
I just realized something that may be very important to my side of the story. It appears that I was skimming over your example when I should have been playing closer attention: On 7/18/05, Damian Conway <[EMAIL PROTECTED]> wrote: > Consider the following classes: > >class A {..

Re: Type::Class::Haskell does Role

2005-07-20 Thread Yuval Kogman
On Sun, Jul 17, 2005 at 18:23:02 +, Luke Palmer wrote: > > * Coercion of parameters and a class's willingness to coerce > > into something is a better metric of distance > > Well, if you think metrics at all are a good way to do dispatch. Well, we do have a notion of "close

Re: The Use and Abuse of Liskov (was: Type::Class::Haskell does Role)

2005-07-19 Thread Luke Palmer
On 7/17/05, Damian Conway <[EMAIL PROTECTED]> wrote: > "You keep using that word. I do not think > it means what you think it means" > -- Inigo Montoya Quite. I abused Liskov's name greatly here. Sorry about that. Anyway, my argument is founded on anothe

The Use and Abuse of Liskov (was: Type::Class::Haskell does Role)

2005-07-17 Thread Damian Conway
"You keep using that word. I do not think it means what you think it means" -- Inigo Montoya Luke Palmer wrote: >>Recently I discussed MMD with chromatic, and he mentioned two things >>that were very important, in my opinion: >> >>* The Liskov subst

Re: Type::Class::Haskell does Role

2005-07-17 Thread Luke Palmer
On 7/17/05, Yuval Kogman <[EMAIL PROTECTED]> wrote: > I have another view. > > The Num role and the Str role both consume the Eq role. When your > class tries to both be a Num and a Str, == conflicts. > > I have two scenarios: > > class Moose does Num does Str { ... } > > # Moos

Re: Type::Class::Haskell does Role

2005-07-16 Thread Yuval Kogman
Atmosphere: Whooosh Mug: Clunk Luke's head: Thud Luke's wall: Dum Luke: Ow Violence is fun! On Sat, Jul 16, 2005 at 19:02:49 -0600, Luke Palmer wrote: > I'm going to have some coffee mugs thrown at me for saying this, but perhaps: > > Generic StringNumericIdentity >

Re: Type::Class::Haskell does Role

2005-07-16 Thread Luke Palmer
On 7/16/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > I'm going to have some coffee mugs thrown at me for saying this, but perhaps: > > Generic StringNumericIdentity >+---+---++---+ > Equality |== |

Re: Type::Class::Haskell does Role

2005-07-16 Thread Luke Palmer
On 16 Jul 2005 12:22:31 -, David Formosa (aka ? the Platypus) <[EMAIL PROTECTED]> wrote: > On Sat, 16 Jul 2005 12:14:24 +0800, Autrijus Tang > <[EMAIL PROTECTED]> wrote: > > [...] > > > On Sat, Jul 16, 2005 at 12:24:21AM +0300, Yuval Kogman wrote: > >> > There is a new generic comparison oper

Re: Type::Class::Haskell does Role

2005-07-16 Thread David Formosa \(aka ? the Platypus\)
On Sat, 16 Jul 2005 12:14:24 +0800, Autrijus Tang <[EMAIL PROTECTED]> wrote: [...] > On Sat, Jul 16, 2005 at 12:24:21AM +0300, Yuval Kogman wrote: >> > There is a new generic comparison operator known as ~~. >>=20 >> ~~ is just Eq, there is also Ord > > Hmm, <~ and ~> for generic comparators? ;

Re: Type::Class::Haskell does Role

2005-07-16 Thread Yuval Kogman
On Sat, Jul 16, 2005 at 12:14:24 +0800, Autrijus Tang wrote: > Hmm, <~ and ~> for generic comparators? ;) EEK! i think <, <=>, >, == etc are enough for the ord and Eq class - that's what most people overload in p5 anyway. > > and Show > > That is already prefix ~ for that. How do you describe

Re: Type::Class::Haskell does Role

2005-07-15 Thread Autrijus Tang
On Sat, Jul 16, 2005 at 12:24:21AM +0300, Yuval Kogman wrote: > > There is a new generic comparison operator known as ~~. > > ~~ is just Eq, there is also Ord Hmm, <~ and ~> for generic comparators? ;) > and Show That is already prefix ~ for that. > and a multitude of other things, which are m

Re: Type::Class::Haskell does Role

2005-07-15 Thread Yuval Kogman
On Fri, Jul 15, 2005 at 10:01:43 +0800, Autrijus Tang wrote: > On Fri, Jul 15, 2005 at 02:38:22AM +0300, Yuval Kogman wrote: > > As I see it == is the generic comparison, and 'eq' is == with > > coercing parameters (in Haskell it'd be > > eq :: (Show a) => a -> a -> Bool or so... Isn't that lovely?

Re: Type::Class::Haskell does Role

2005-07-14 Thread Autrijus Tang
On Fri, Jul 15, 2005 at 02:38:22AM +0300, Yuval Kogman wrote: > As I see it == is the generic comparison, and 'eq' is == with > coercing parameters (in Haskell it'd be > eq :: (Show a) => a -> a -> Bool or so... Isn't that lovely?) There is a new generic comparison operator known as ~~. The dispa

Type::Class::Haskell does Role

2005-07-14 Thread Yuval Kogman
Haskell has this very nice consistency I'll diverge into perl terms... The 'Show' role provides consistent stringification semantics for any type that does the role. It can even 'derive' the role, getting a method autogenerated. The 'Ord' role provides semantics for ordered types. A typical s