Re: Type annotation on expressions

2006-08-08 Thread Yuval Kogman
On Tue, Aug 08, 2006 at 11:42:15 +, Luke Palmer wrote: > I'm not up-to-date on coersion; last I checked it was hand-wavily > defined. Currently it's a unary multimethod: my $hamburger = $cow.as(Food); However, the MMD rules are counterintuitive for dispatch rules. The reason annota

Re: Type annotation on expressions

2006-08-08 Thread Luke Palmer
On 8/8/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: It's much more relevant for: fun( $x.foo :: Bar ); in order to annotate the return type for a call's context even if the 'fun' function's signature accepts Any. Touche, this is independent of type inference. I'm not up-to-date on coe

Re: Type annotation on expressions

2006-08-08 Thread Yuval Kogman
Actually this particular example is just like coercion, and it's a bad one sorry. It's much more relevant for: fun( $x.foo :: Bar ); in order to annotate the return type for a call's context even if the 'fun' function's signature accepts Any. -- Yuval Kogman <[EMAIL PROTECTED]> h

Re: Type annotation on expressions

2006-08-08 Thread Luke Palmer
On 8/8/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: On Tue, Aug 08, 2006 at 11:12:11 +0100, Daniel Hulme wrote: > I may be in a little world of my own here, but isn't this what 'as' is > supposed to do? > > foo($x as Moose); as is a method invocation not a type annotation... It's related, but no

Re: Type annotation on expressions

2006-08-08 Thread Yuval Kogman
On Tue, Aug 08, 2006 at 11:12:11 +0100, Daniel Hulme wrote: > I may be in a little world of my own here, but isn't this what 'as' is > supposed to do? > > foo($x as Moose); as is a method invocation not a type annotation... It's related, but not the same (last I heard) -- Yuval Kogman <[EMAI

Re: Type annotation on expressions

2006-08-08 Thread Daniel Hulme
> Is it possible to say this one expression? Haskell's syntax is shiny > but everybody wants the colon: > > foo( ( $x :: Moose ) ); I may be in a little world of my own here, but isn't this what 'as' is supposed to do? foo($x as Moose); -- "Of all things, good sense is the most fairly