This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Re: White Elefant

34 replies
Cédric Beust ♔
Joined: 2011-06-17,
User offline. Last seen 42 years 45 weeks ago.
Oh and by the way, I most likely started using Java before you :-)
-- Cédric




2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>


I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created) public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.
Either way, my original point stands: it's really no big deal to tell beginners to not pay attention to some details in the early stages.
--  Cédric

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: Re: White Elefant


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
Oh and by the way, I most likely started using Java before you :-)
-- Cédric


I think the way these things work, though, is that the most kudos points go to whoever first wrote an improved version of javac, which still represents the core of Oracle's current offering :)  
 


2011/10/26 Cédric Beust ♔ <cedric [at] beust [dot] com>
2011/10/26 martin odersky <martin [dot] odersky [at] epfl [dot] ch>


I definitely disagree with that. 
class    -- need to explain what a class is, and why Hello is not really one (because no instances are ever created) public   -- need to explain privacy levels  static    -- what the heck is that?void      -- void???main     OK, I might get thatString[] -- need to explain irregular array syntaxargs     -- need to explain command line arguments

Maybe for someone who's never programmed in their life, but I bet that most people who started programming in Java had some prior exposure to C and/or C++, so I still think the description above is vastly overblown.
Either way, my original point stands: it's really no big deal to tell beginners to not pay attention to some details in the early stages.
--  Cédric



H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: White Elefant
even after fixing the b to B, it doesn't compile. where does "*->*->*" come from? the trait's name is *->*->**. i am not familiar with these -> and *-stuff, so i don't know what it's supposed to do. maybe if it would compile.

Am 27.10.2011 18:43, schrieb Peter C. Chapin:

Are you talking about the lower case b in F[A, b]? I figured it was probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’ in scope.

 

Peter

 

From: Rex Kerr [ichoran [at] gmail [dot] com (mailto:ichoran [at] gmail [dot] com)]
Sent: Thursday, October 27, 2011 12:16
To: Chapin, Peter @ VTC
Cc: scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

 

Do you see the typo, then? :)

  --Rex

P.S. I'm almost positive it is a typo, but without more context I can't be 100% sure.

On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin <PChapin [at] vtc [dot] vsc [dot] edu" rel="nofollow">PChapin [at] vtc [dot] vsc [dot] edu> wrote:

Ok, I’m starting to feel scared. That code actually looks fairly understandable to me.

 

Peter

 

From: scala-debate [at] googlegroups [dot] com" target="_blank" rel="nofollow">scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com" target="_blank" rel="nofollow">scala-debate [at] googlegroups [dot] com] On Behalf Of Razvan Cojocaru
Sent: Wednesday, October 26, 2011 13:38
To: 'martin odersky'
Cc: 'Kevin Wright'; 'scala-debate'
Subject: RE: [scala-debate] Re: [scala-user] White Elefant

 

 

trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]): *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }

 

 

 


Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Well, since it’s now a debate and seriously derailed (I’m seriously sorry about that serious problem), I found out (thanks, Daniel) that *->*->* actually stands for something: it’s the “kind of a  binary type constructor”.

 

So that particular trait’s name has a meaning…

 

Otherwise, my translation of that code stands as below: http://pastie.org/2742209

 

First, the names need decoding:

F[_,_] is like a Map [A,B] in any reasonable language: it's a type parametrized in two other types, we'll call it SomeMap.

A and B are any ordinary types.

The name of the implicit should be irrelevant, since its' well - implicit!

The *->*->* class, which is missing, looks like a MapPimp - it wraps maps for whatever reason, maybe to add new methods to it (i.e. pimp it). a and b are probably typing errors, we'll correct that. using value for member is nasty, will replace with "pimped"

The *->*->** trait here is meant to be mixed into a class, in which class, the implicit will automatically wrap any map of any two types A and B into a MapPimp and will probably add new methods - this is the "pimping pattern" classical in scala.

With all this, the nasty code

trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]): *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }

becomes the trait MapHelper in the full sample here:
http://pastie.org/2742209

 

 

From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com] On Behalf Of HamsterofDeath
Sent: October-27-11 12:59 PM
To: scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

 

even after fixing the b to B, it doesn't compile. where does "*->*->*" come from? the trait's name is *->*->**. i am not familiar with these -> and *-stuff, so i don't know what it's supposed to do. maybe if it would compile.

Am 27.10.2011 18:43, schrieb Peter C. Chapin:

Are you talking about the lower case b in F[A, b]? I figured it was probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’ in scope.

 

Peter

 

From: Rex Kerr [ichoran [at] gmail [dot] com (mailto:ichoran [at] gmail [dot] com)]
Sent: Thursday, October 27, 2011 12:16
To: Chapin, Peter @ VTC
Cc: scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

 

Do you see the typo, then? :)

  --Rex

P.S. I'm almost positive it is a typo, but without more context I can't be 100% sure.

On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin <PChapin [at] vtc [dot] vsc [dot] edu> wrote:

Ok, I’m starting to feel scared. That code actually looks fairly understandable to me.

 

Peter

 

From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com] On Behalf Of Razvan Cojocaru
Sent: Wednesday, October 26, 2011 13:38
To: 'martin odersky'
Cc: 'Kevin Wright'; 'scala-debate'
Subject: RE: [scala-debate] Re: [scala-user] White Elefant

 

 

trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]): *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }

 

 

 

 

Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
> Well, since it’s now a debate and seriously derailed (I’m seriously sorry
> about that serious problem), I found out (thanks, Daniel) that *->*->*
> actually stands for something: it’s the “kind of a  binary type
> constructor”.
>
>
>
> So that particular trait’s name has a meaning…
>
>
>
> Otherwise, my translation of that code stands as below:
> http://pastie.org/2742209
>
>
>
> First, the names need decoding:
>
> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
> parametrized in two other types, we'll call it SomeMap.

Nope. F[_, _] is any type constructor that takes 2 types as
parameters. This _could_be_ Map, but doesn't have to be. Other types
that would work are Either, EitherT[_, F, _], State, StateT[_, F, _],
Reader, Kleisli[_, F, _] (also known as ReaderT[_, F, _]), and other
computations that you may want to compose. It has nothing to do with
Maps in particular, except that Map happens to also be a Function1
which, oh look, has 2 type parameters!

Rich

>
> A and B are any ordinary types.
>
> The name of the implicit should be irrelevant, since its' well - implicit!
>
> The *->*->* class, which is missing, looks like a MapPimp - it wraps maps
> for whatever reason, maybe to add new methods to it (i.e. pimp it). a and b
> are probably typing errors, we'll correct that. using value for member is
> nasty, will replace with "pimped"
>
> The *->*->** trait here is meant to be mixed into a class, in which class,
> the implicit will automatically wrap any map of any two types A and B into a
> MapPimp and will probably add new methods - this is the "pimping pattern"
> classical in scala.
>
> With all this, the nasty code
>
> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]): *->*->*[A,
> F, B] = new *->*->*[A, F, B] { val value = a } }
>
> becomes the trait MapHelper in the full sample here:
> http://pastie.org/2742209
>
>
>
>
>
> From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com]
> On Behalf Of HamsterofDeath
> Sent: October-27-11 12:59 PM
> To: scala-debate [at] googlegroups [dot] com
>
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> even after fixing the b to B, it doesn't compile. where does "*->*->*" come
> from? the trait's name is *->*->**. i am not familiar with these -> and
> *-stuff, so i don't know what it's supposed to do. maybe if it would
> compile.
>
> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>
> Are you talking about the lower case b in F[A, b]? I figured it was probably
> supposed to be F[A, B] but who knows… maybe there is a type ‘b’ in scope.
>
>
>
> Peter
>
>
>
> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
> Sent: Thursday, October 27, 2011 12:16
> To: Chapin, Peter @ VTC
> Cc: scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> Do you see the typo, then? :)
>
>   --Rex
>
> P.S. I'm almost positive it is a typo, but without more context I can't be
> 100% sure.
>
> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
> wrote:
>
> Ok, I’m starting to feel scared. That code actually looks fairly
> understandable to me.
>
>
>
> Peter
>
>
>
> From: scala-debate [at] googlegroups [dot] com [mailto:scala-debate [at] googlegroups [dot] com]
> On Behalf Of Razvan Cojocaru
> Sent: Wednesday, October 26, 2011 13:38
> To: 'martin odersky'
> Cc: 'Kevin Wright'; 'scala-debate'
> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>
>
>
>
>
> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]): *->*->*[A,
> F, B] = new *->*->*[A, F, B] { val value = a } }
>
>
>
>
>
>
>
>

Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

On Thu, Oct 27, 2011 at 11:20 AM, Razvan Cojocaru wrote:
> Keeping this in context - would you seriously be trying to explain
> Kleisli[_, F, _] or the State monad to a Java guy complaining Scala is too
> complex?
>

Yes. These things are pretty easy concepts to learn. I mean really,
what' hard about explaining A => F[B]?

> -----Original Message-----
> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
> Sent: October-27-11 2:12 PM
> To: Razvan Cojocaru
> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
> On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
>> Well, since it’s now a debate and seriously derailed (I’m seriously
>> sorry about that serious problem), I found out (thanks, Daniel) that
>> *->*->* actually stands for something: it’s the “kind of a  binary
>> type constructor”.
>>
>>
>>
>> So that particular trait’s name has a meaning…
>>
>>
>>
>> Otherwise, my translation of that code stands as below:
>> http://pastie.org/2742209
>>
>>
>>
>> First, the names need decoding:
>>
>> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
>> parametrized in two other types, we'll call it SomeMap.
>
> Nope.  F[_, _] is any type constructor that takes 2 types as parameters.
> This _could_be_ Map, but doesn't have to be.  Other types that would work
> are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader, Kleisli[_, F,
> _] (also known as ReaderT[_, F, _]), and other computations that you may
> want to compose.  It has nothing to do with Maps in particular, except that
> Map happens to also be a Function1 which, oh look, has 2 type parameters!
>
> Rich
>
>>
>> A and B are any ordinary types.
>>
>> The name of the implicit should be irrelevant, since its' well - implicit!
>>
>> The *->*->* class, which is missing, looks like a MapPimp - it wraps
>> maps for whatever reason, maybe to add new methods to it (i.e. pimp
>> it). a and b are probably typing errors, we'll correct that. using
>> value for member is nasty, will replace with "pimped"
>>
>> The *->*->** trait here is meant to be mixed into a class, in which
>> class, the implicit will automatically wrap any map of any two types A
>> and B into a MapPimp and will probably add new methods - this is the
> "pimping pattern"
>> classical in scala.
>>
>> With all this, the nasty code
>>
>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>
>> becomes the trait MapHelper in the full sample here:
>> http://pastie.org/2742209
>>
>>
>>
>>
>>
>> From: scala-debate [at] googlegroups [dot] com
>> [mailto:scala-debate [at] googlegroups [dot] com]
>> On Behalf Of HamsterofDeath
>> Sent: October-27-11 12:59 PM
>> To: scala-debate [at] googlegroups [dot] com
>>
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>> even after fixing the b to B, it doesn't compile. where does "*->*->*"
>> come from? the trait's name is *->*->**. i am not familiar with these
>> -> and *-stuff, so i don't know what it's supposed to do. maybe if it
>> would compile.
>>
>> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>>
>> Are you talking about the lower case b in F[A, b]? I figured it was
>> probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
> in scope.
>>
>>
>>
>> Peter
>>
>>
>>
>> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
>> Sent: Thursday, October 27, 2011 12:16
>> To: Chapin, Peter @ VTC
>> Cc: scala-debate [at] googlegroups [dot] com
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>> Do you see the typo, then? :)
>>
>>   --Rex
>>
>> P.S. I'm almost positive it is a typo, but without more context I
>> can't be 100% sure.
>>
>> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
>> wrote:
>>
>> Ok, I’m starting to feel scared. That code actually looks fairly
>> understandable to me.
>>
>>
>>
>> Peter
>>
>>
>>
>> From: scala-debate [at] googlegroups [dot] com
>> [mailto:scala-debate [at] googlegroups [dot] com]
>> On Behalf Of Razvan Cojocaru
>> Sent: Wednesday, October 26, 2011 13:38
>> To: 'martin odersky'
>> Cc: 'Kevin Wright'; 'scala-debate'
>> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>>
>>
>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>
>>
>>
>>
>>
>>
>>
>>
>
>

Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Keeping this in context - would you seriously be trying to explain
Kleisli[_, F, _] or the State monad to a Java guy complaining Scala is too
complex?

-----Original Message-----
From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
Sent: October-27-11 2:12 PM
To: Razvan Cojocaru
Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
> Well, since it’s now a debate and seriously derailed (I’m seriously
> sorry about that serious problem), I found out (thanks, Daniel) that
> *->*->* actually stands for something: it’s the “kind of a  binary
> type constructor”.
>
>
>
> So that particular trait’s name has a meaning…
>
>
>
> Otherwise, my translation of that code stands as below:
> http://pastie.org/2742209
>
>
>
> First, the names need decoding:
>
> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
> parametrized in two other types, we'll call it SomeMap.

Nope. F[_, _] is any type constructor that takes 2 types as parameters.
This _could_be_ Map, but doesn't have to be. Other types that would work
are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader, Kleisli[_, F,
_] (also known as ReaderT[_, F, _]), and other computations that you may
want to compose. It has nothing to do with Maps in particular, except that
Map happens to also be a Function1 which, oh look, has 2 type parameters!

Rich

>
> A and B are any ordinary types.
>
> The name of the implicit should be irrelevant, since its' well - implicit!
>
> The *->*->* class, which is missing, looks like a MapPimp - it wraps
> maps for whatever reason, maybe to add new methods to it (i.e. pimp
> it). a and b are probably typing errors, we'll correct that. using
> value for member is nasty, will replace with "pimped"
>
> The *->*->** trait here is meant to be mixed into a class, in which
> class, the implicit will automatically wrap any map of any two types A
> and B into a MapPimp and will probably add new methods - this is the
"pimping pattern"
> classical in scala.
>
> With all this, the nasty code
>
> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>
> becomes the trait MapHelper in the full sample here:
> http://pastie.org/2742209
>
>
>
>
>
> From: scala-debate [at] googlegroups [dot] com
> [mailto:scala-debate [at] googlegroups [dot] com]
> On Behalf Of HamsterofDeath
> Sent: October-27-11 12:59 PM
> To: scala-debate [at] googlegroups [dot] com
>
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> even after fixing the b to B, it doesn't compile. where does "*->*->*"
> come from? the trait's name is *->*->**. i am not familiar with these
> -> and *-stuff, so i don't know what it's supposed to do. maybe if it
> would compile.
>
> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>
> Are you talking about the lower case b in F[A, b]? I figured it was
> probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
in scope.
>
>
>
> Peter
>
>
>
> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
> Sent: Thursday, October 27, 2011 12:16
> To: Chapin, Peter @ VTC
> Cc: scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> Do you see the typo, then? :)
>
>   --Rex
>
> P.S. I'm almost positive it is a typo, but without more context I
> can't be 100% sure.
>
> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
> wrote:
>
> Ok, I’m starting to feel scared. That code actually looks fairly
> understandable to me.
>
>
>
> Peter
>
>
>
> From: scala-debate [at] googlegroups [dot] com
> [mailto:scala-debate [at] googlegroups [dot] com]
> On Behalf Of Razvan Cojocaru
> Sent: Wednesday, October 26, 2011 13:38
> To: 'martin odersky'
> Cc: 'Kevin Wright'; 'scala-debate'
> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>
>
>
>
>
> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>
>
>
>
>
>
>
>

Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Ok... I wouldn't. Eitherway, in that case *you* must understand that
Either[A,B] is like Map[A,B], in the sense that they are both types
parameterised with two other types. You can certainly call them "type
constructors" but I'll refer you to the "Type Parameterization" chapter of
the scala bible, to eliminate doubt.

So - re-reading my original explanation, was I wrong or were you trigger
happy? LOL

To the larger audience: Hey - this public laundering can be on debate,
right?

-----Original Message-----
From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
Sent: October-27-11 2:23 PM
To: Razvan Cojocaru
Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

On Thu, Oct 27, 2011 at 11:20 AM, Razvan Cojocaru wrote:
> Keeping this in context - would you seriously be trying to explain
> Kleisli[_, F, _] or the State monad to a Java guy complaining Scala is
> too complex?
>

Yes. These things are pretty easy concepts to learn. I mean really, what'
hard about explaining A => F[B]?

> -----Original Message-----
> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
> Sent: October-27-11 2:12 PM
> To: Razvan Cojocaru
> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
> On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
>> Well, since it’s now a debate and seriously derailed (I’m seriously
>> sorry about that serious problem), I found out (thanks, Daniel) that
>> *->*->* actually stands for something: it’s the “kind of a  binary
>> type constructor”.
>>
>>
>>
>> So that particular trait’s name has a meaning…
>>
>>
>>
>> Otherwise, my translation of that code stands as below:
>> http://pastie.org/2742209
>>
>>
>>
>> First, the names need decoding:
>>
>> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
>> parametrized in two other types, we'll call it SomeMap.
>
> Nope.  F[_, _] is any type constructor that takes 2 types as parameters.
> This _could_be_ Map, but doesn't have to be.  Other types that would
> work are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader,
> Kleisli[_, F, _] (also known as ReaderT[_, F, _]), and other
> computations that you may want to compose.  It has nothing to do with
> Maps in particular, except that Map happens to also be a Function1 which,
oh look, has 2 type parameters!
>
> Rich
>
>>
>> A and B are any ordinary types.
>>
>> The name of the implicit should be irrelevant, since its' well -
implicit!
>>
>> The *->*->* class, which is missing, looks like a MapPimp - it wraps
>> maps for whatever reason, maybe to add new methods to it (i.e. pimp
>> it). a and b are probably typing errors, we'll correct that. using
>> value for member is nasty, will replace with "pimped"
>>
>> The *->*->** trait here is meant to be mixed into a class, in which
>> class, the implicit will automatically wrap any map of any two types
>> A and B into a MapPimp and will probably add new methods - this is
>> the
> "pimping pattern"
>> classical in scala.
>>
>> With all this, the nasty code
>>
>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>
>> becomes the trait MapHelper in the full sample here:
>> http://pastie.org/2742209
>>
>>
>>
>>
>>
>> From: scala-debate [at] googlegroups [dot] com
>> [mailto:scala-debate [at] googlegroups [dot] com]
>> On Behalf Of HamsterofDeath
>> Sent: October-27-11 12:59 PM
>> To: scala-debate [at] googlegroups [dot] com
>>
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>> even after fixing the b to B, it doesn't compile. where does "*->*->*"
>> come from? the trait's name is *->*->**. i am not familiar with these
>> -> and *-stuff, so i don't know what it's supposed to do. maybe if it
>> would compile.
>>
>> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>>
>> Are you talking about the lower case b in F[A, b]? I figured it was
>> probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
> in scope.
>>
>>
>>
>> Peter
>>
>>
>>
>> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
>> Sent: Thursday, October 27, 2011 12:16
>> To: Chapin, Peter @ VTC
>> Cc: scala-debate [at] googlegroups [dot] com
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>> Do you see the typo, then? :)
>>
>>   --Rex
>>
>> P.S. I'm almost positive it is a typo, but without more context I
>> can't be 100% sure.
>>
>> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
>>
>> wrote:
>>
>> Ok, I’m starting to feel scared. That code actually looks fairly
>> understandable to me.
>>
>>
>>
>> Peter
>>
>>
>>
>> From: scala-debate [at] googlegroups [dot] com
>> [mailto:scala-debate [at] googlegroups [dot] com]
>> On Behalf Of Razvan Cojocaru
>> Sent: Wednesday, October 26, 2011 13:38
>> To: 'martin odersky'
>> Cc: 'Kevin Wright'; 'scala-debate'
>> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>>
>>
>>
>>
>>
>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>
>>
>>
>>
>>
>>
>>
>>
>
>

Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

On Thu, Oct 27, 2011 at 12:02 PM, Razvan Cojocaru wrote:
> Ok... I wouldn't. Eitherway, in that case *you* must understand that
> Either[A,B] is like Map[A,B], in the sense that they are both types
> parameterised with two other types.

Isn't that exactly what I said?

> You can certainly call them "type
> constructors" but I'll refer you to the "Type Parameterization" chapter of
> the scala bible, to eliminate doubt.
>
> So - re-reading my original explanation, was I wrong or were you trigger
> happy? LOL

You were wrong.

>
> To the larger audience: Hey - this public laundering can be on debate,
> right?
>
> -----Original Message-----
> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
> Sent: October-27-11 2:23 PM
> To: Razvan Cojocaru
> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
> On Thu, Oct 27, 2011 at 11:20 AM, Razvan Cojocaru wrote:
>> Keeping this in context - would you seriously be trying to explain
>> Kleisli[_, F, _] or the State monad to a Java guy complaining Scala is
>> too complex?
>>
>
> Yes.  These things are pretty easy concepts to learn.  I mean really, what'
> hard about explaining A => F[B]?
>
>> -----Original Message-----
>> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
>> Sent: October-27-11 2:12 PM
>> To: Razvan Cojocaru
>> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>> On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
>>> Well, since it’s now a debate and seriously derailed (I’m seriously
>>> sorry about that serious problem), I found out (thanks, Daniel) that
>>> *->*->* actually stands for something: it’s the “kind of a  binary
>>> type constructor”.
>>>
>>>
>>>
>>> So that particular trait’s name has a meaning…
>>>
>>>
>>>
>>> Otherwise, my translation of that code stands as below:
>>> http://pastie.org/2742209
>>>
>>>
>>>
>>> First, the names need decoding:
>>>
>>> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
>>> parametrized in two other types, we'll call it SomeMap.
>>
>> Nope.  F[_, _] is any type constructor that takes 2 types as parameters.
>> This _could_be_ Map, but doesn't have to be.  Other types that would
>> work are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader,
>> Kleisli[_, F, _] (also known as ReaderT[_, F, _]), and other
>> computations that you may want to compose.  It has nothing to do with
>> Maps in particular, except that Map happens to also be a Function1 which,
> oh look, has 2 type parameters!
>>
>> Rich
>>
>>>
>>> A and B are any ordinary types.
>>>
>>> The name of the implicit should be irrelevant, since its' well -
> implicit!
>>>
>>> The *->*->* class, which is missing, looks like a MapPimp - it wraps
>>> maps for whatever reason, maybe to add new methods to it (i.e. pimp
>>> it). a and b are probably typing errors, we'll correct that. using
>>> value for member is nasty, will replace with "pimped"
>>>
>>> The *->*->** trait here is meant to be mixed into a class, in which
>>> class, the implicit will automatically wrap any map of any two types
>>> A and B into a MapPimp and will probably add new methods - this is
>>> the
>> "pimping pattern"
>>> classical in scala.
>>>
>>> With all this, the nasty code
>>>
>>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>>
>>> becomes the trait MapHelper in the full sample here:
>>> http://pastie.org/2742209
>>>
>>>
>>>
>>>
>>>
>>> From: scala-debate [at] googlegroups [dot] com
>>> [mailto:scala-debate [at] googlegroups [dot] com]
>>> On Behalf Of HamsterofDeath
>>> Sent: October-27-11 12:59 PM
>>> To: scala-debate [at] googlegroups [dot] com
>>>
>>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>> even after fixing the b to B, it doesn't compile. where does "*->*->*"
>>> come from? the trait's name is *->*->**. i am not familiar with these
>>> -> and *-stuff, so i don't know what it's supposed to do. maybe if it
>>> would compile.
>>>
>>> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>>>
>>> Are you talking about the lower case b in F[A, b]? I figured it was
>>> probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
>> in scope.
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
>>> Sent: Thursday, October 27, 2011 12:16
>>> To: Chapin, Peter @ VTC
>>> Cc: scala-debate [at] googlegroups [dot] com
>>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>> Do you see the typo, then? :)
>>>
>>>   --Rex
>>>
>>> P.S. I'm almost positive it is a typo, but without more context I
>>> can't be 100% sure.
>>>
>>> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
>>>
>>> wrote:
>>>
>>> Ok, I’m starting to feel scared. That code actually looks fairly
>>> understandable to me.
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>> From: scala-debate [at] googlegroups [dot] com
>>> [mailto:scala-debate [at] googlegroups [dot] com]
>>> On Behalf Of Razvan Cojocaru
>>> Sent: Wednesday, October 26, 2011 13:38
>>> To: 'martin odersky'
>>> Cc: 'Kevin Wright'; 'scala-debate'
>>> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>>
>>>
>>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>

Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Well - at this point, in my actual mind there's only Umberto Eco saying
basically that there's so much stuff in existence, that any reasonably short
but random sequence of symbols can be found to be a representation of
something else... whether that hints of occult, is a different question
altogether, heh!

Sorry for derailing the debate - let's go back to it.

-----Original Message-----
From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
Sent: October-27-11 3:25 PM
To: Razvan Cojocaru
Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

On Thu, Oct 27, 2011 at 12:02 PM, Razvan Cojocaru wrote:
> Ok... I wouldn't. Eitherway, in that case *you* must understand that
> Either[A,B] is like Map[A,B], in the sense that they are both types
> parameterised with two other types.

Isn't that exactly what I said?

> You can certainly call them "type
> constructors" but I'll refer you to the "Type Parameterization"
> chapter of the scala bible, to eliminate doubt.
>
> So - re-reading my original explanation, was I wrong or were you
> trigger happy? LOL

You were wrong.

>
> To the larger audience: Hey - this public laundering can be on debate,
> right?
>
> -----Original Message-----
> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
> Sent: October-27-11 2:23 PM
> To: Razvan Cojocaru
> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
> On Thu, Oct 27, 2011 at 11:20 AM, Razvan Cojocaru wrote:
>> Keeping this in context - would you seriously be trying to explain
>> Kleisli[_, F, _] or the State monad to a Java guy complaining Scala
>> is too complex?
>>
>
> Yes.  These things are pretty easy concepts to learn.  I mean really,
what'
> hard about explaining A => F[B]?
>
>> -----Original Message-----
>> From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
>> Sent: October-27-11 2:12 PM
>> To: Razvan Cojocaru
>> Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>
>> On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru wrote:
>>> Well, since it’s now a debate and seriously derailed (I’m seriously
>>> sorry about that serious problem), I found out (thanks, Daniel) that
>>> *->*->* actually stands for something: it’s the “kind of a  binary
>>> type constructor”.
>>>
>>>
>>>
>>> So that particular trait’s name has a meaning…
>>>
>>>
>>>
>>> Otherwise, my translation of that code stands as below:
>>> http://pastie.org/2742209
>>>
>>>
>>>
>>> First, the names need decoding:
>>>
>>> F[_,_] is like a Map [A,B] in any reasonable language: it's a type
>>> parametrized in two other types, we'll call it SomeMap.
>>
>> Nope.  F[_, _] is any type constructor that takes 2 types as parameters.
>> This _could_be_ Map, but doesn't have to be.  Other types that would
>> work are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader,
>> Kleisli[_, F, _] (also known as ReaderT[_, F, _]), and other
>> computations that you may want to compose.  It has nothing to do with
>> Maps in particular, except that Map happens to also be a Function1
>> which,
> oh look, has 2 type parameters!
>>
>> Rich
>>
>>>
>>> A and B are any ordinary types.
>>>
>>> The name of the implicit should be irrelevant, since its' well -
> implicit!
>>>
>>> The *->*->* class, which is missing, looks like a MapPimp - it wraps
>>> maps for whatever reason, maybe to add new methods to it (i.e. pimp
>>> it). a and b are probably typing errors, we'll correct that. using
>>> value for member is nasty, will replace with "pimped"
>>>
>>> The *->*->** trait here is meant to be mixed into a class, in which
>>> class, the implicit will automatically wrap any map of any two types
>>> A and B into a MapPimp and will probably add new methods - this is
>>> the
>> "pimping pattern"
>>> classical in scala.
>>>
>>> With all this, the nasty code
>>>
>>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>>
>>> becomes the trait MapHelper in the full sample here:
>>> http://pastie.org/2742209
>>>
>>>
>>>
>>>
>>>
>>> From: scala-debate [at] googlegroups [dot] com
>>> [mailto:scala-debate [at] googlegroups [dot] com]
>>> On Behalf Of HamsterofDeath
>>> Sent: October-27-11 12:59 PM
>>> To: scala-debate [at] googlegroups [dot] com
>>>
>>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>> even after fixing the b to B, it doesn't compile. where does "*->*->*"
>>> come from? the trait's name is *->*->**. i am not familiar with
>>> these
>>> -> and *-stuff, so i don't know what it's supposed to do. maybe if
>>> -> it
>>> would compile.
>>>
>>> Am 27.10.2011 18:43, schrieb Peter C. Chapin:
>>>
>>> Are you talking about the lower case b in F[A, b]? I figured it was
>>> probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
>> in scope.
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>> From: Rex Kerr [mailto:ichoran [at] gmail [dot] com]
>>> Sent: Thursday, October 27, 2011 12:16
>>> To: Chapin, Peter @ VTC
>>> Cc: scala-debate [at] googlegroups [dot] com
>>> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>> Do you see the typo, then? :)
>>>
>>>   --Rex
>>>
>>> P.S. I'm almost positive it is a typo, but without more context I
>>> can't be 100% sure.
>>>
>>> On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin
>>>
>>> wrote:
>>>
>>> Ok, I’m starting to feel scared. That code actually looks fairly
>>> understandable to me.
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>> From: scala-debate [at] googlegroups [dot] com
>>> [mailto:scala-debate [at] googlegroups [dot] com]
>>> On Behalf Of Razvan Cojocaru
>>> Sent: Wednesday, October 26, 2011 13:38
>>> To: 'martin odersky'
>>> Cc: 'Kevin Wright'; 'scala-debate'
>>> Subject: RE: [scala-debate] Re: [scala-user] White Elefant
>>>
>>>
>>>
>>>
>>>
>>> trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
>>> *->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant


On Thu, Oct 27, 2011 at 3:24 PM, Richard Wallace <rwallace [at] thewallacepack [dot] net> wrote:
On Thu, Oct 27, 2011 at 12:02 PM, Razvan Cojocaru <pub [at] razie [dot] com> wrote:
> Ok... I wouldn't. Eitherway, in that case *you* must understand that
> Either[A,B] is like Map[A,B], in the sense that they are both types
> parameterised with two other types.

Isn't that exactly what I said?

> You can certainly call them "type
> constructors" but I'll refer you to the "Type Parameterization" chapter of
> the scala bible, to eliminate doubt.
>
> So - re-reading my original explanation, was I wrong or were you trigger
> happy? LOL

You were wrong.

How bout we get pedantic here, since it's scala-debate.  You're both wrong *and* correct, depending on how you view things.   Scala has a specific meaning for "type constructors ".
Foo[_, X] is *not* a type constructor (necessarily).  It's normally existential type.   However, in a parameter position (where Foo is the parameter name) then it can refer to a type constructor, but certainly has no meaning.  (i.e. Tuple2[_,_] is either *any* two argument type constructor *or must be* an existential type.).  In the case of placing default values in positions of type constructor parameters (Foo[X,_,_]), I don't think this is legal Scala code (but I don't recall correctly, because It's a rare used feature for me).
type Bar[Y] = Foo[Y,X] // Bar is a type constructor.
There's is also "Type parameterization", which has valid meaning in Scala.
From the spec: A parameterized type T [U1, ..., Un] consists of a type designator T and type parameters U1, ..., Un where n ¸ 1. T must refer to a type constructor which takes n type parameters a1, ..., an."
So, for everyone's sake:  A Parameterized type is akin to a method call and a type constructor is akin to a method definition.   The parameterized type has all the parameters specified.  A type constructor is a 'blank' means of creating a new type.  
In any case, writing "Map{A,B]" is confusing the point here.  You're providing two types in the A and B slots.   "Map" is the type constructor, A and B could be valid types and so Map[A,B] would be a parameterized types.
So, for everyone:  The concepts are relatively simple.  A good way to think of type parameters and type constructors and types are: method-arguments, methods and values at 'compile time'.  Kinds can abstract over these further, but the same principles in usage apply.   The terminology is just slightly different.  However, getting your head to wrap around the abstract thought can be difficult the first time.   I wouldn't start with this with my Java friends, but I'd eventually try to teach them this.   It's something I think most programmers can learn, it just takes time.   Patience being what I want most in a teacher.
- Josh

Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

On Thu, Oct 27, 2011 at 1:08 PM, Josh Suereth wrote:
>
>
> On Thu, Oct 27, 2011 at 3:24 PM, Richard Wallace
> wrote:
>>
>> On Thu, Oct 27, 2011 at 12:02 PM, Razvan Cojocaru wrote:
>> > Ok... I wouldn't. Eitherway, in that case *you* must understand that
>> > Either[A,B] is like Map[A,B], in the sense that they are both types
>> > parameterised with two other types.
>>
>> Isn't that exactly what I said?
>>
>> > You can certainly call them "type
>> > constructors" but I'll refer you to the "Type Parameterization" chapter
>> > of
>> > the scala bible, to eliminate doubt.
>> >
>> > So - re-reading my original explanation, was I wrong or were you trigger
>> > happy? LOL
>>
>> You were wrong.
>
> How bout we get pedantic here, since it's scala-debate.  You're both wrong
> *and* correct, depending on how you view things.   Scala has a specific
> meaning for "type constructors ".
> Foo[_, X] is *not* a type constructor (necessarily).  It's normally
> existential type.   However, in a parameter position (where Foo is the
> parameter name) then it can refer to a type constructor, but certainly has
> no meaning.  (i.e. Tuple2[_,_] is either *any* two argument type constructor
> *or must be* an existential type.).  In the case of placing default values
> in positions of type constructor parameters (Foo[X,_,_]), I don't think this
> is legal Scala code (but I don't recall correctly, because It's a rare used
> feature for me).
> type Bar[Y] = Foo[Y,X] // Bar is a type constructor.

Yes, I was being lazy and using F[_, G, _] to mean ({type λ[α, β] =
F[α, G, β]})#λ. I really really wish Scala had better shorthand for
that. FWIW, I think F[_, _] makes more sense for these partially
applied type constructors than it does for existential types. Sadly,
that decision has been made and is likely irreversible.

> There's is also "Type parameterization", which has valid meaning in Scala.
> From the spec: A parameterized type T [U1, ..., Un] consists of a type
> designator T and type parameters U1, ..., Un where n ¸ 1. T must refer to a
> type constructor which takes n type
> parameters a1, ..., an."
> So, for everyone's sake:  A Parameterized type is akin to a method call and
> a type constructor is akin to a method definition.   The parameterized type
> has all the parameters specified.  A type constructor is a 'blank' means of
> creating a new type.
> In any case, writing "Map{A,B]" is confusing the point here.  You're
> providing two types in the A and B slots.   "Map" is the type constructor, A
> and B could be valid types and so Map[A,B] would be a parameterized types.
> So, for everyone:  The concepts are relatively simple.  A good way to think
> of type parameters and type constructors and types are: method-arguments,
> methods and values at 'compile time'.  Kinds can abstract over these
> further, but the same principles in usage apply.   The terminology is just
> slightly different.  However, getting your head to wrap around the abstract
> thought can be difficult the first time.   I wouldn't start with this with
> my Java friends, but I'd eventually try to teach them this.   It's something
> I think most programmers can learn, it just takes time.   Patience being
> what I want most in a teacher.
> - Josh
>
>

Ittay Dror 2
Joined: 2010-05-05,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant
body p { margin-bottom: 0cm; margin-top: 0pt; }



Richard Wallace wrote:
i4mfjYzPLWbo7GRDZyJqZUbW8yHRouOH8CFT8RcgPJA [at] mail [dot] gmail [dot] com" type="cite">
On Thu, Oct 27, 2011 at 11:20 AM, Razvan Cojocaru pub [at] razie [dot] com (<pub [at] razie [dot] com>) wrote:
Keeping this in context - would you seriously be trying to explain
Kleisli[_, F, _] or the State monad to a Java guy complaining Scala is too
complex?

Yes.  These things are pretty easy concepts to learn.  I mean really,
what' hard about explaining A => F[B]?
They are good abstractions. Which is the difficult part. I think people feel comfortable with more tangible things, like Person class, than abstract concepts that can be applied anywhere. This is, IMHO, why people are scared of math in general, even though the rules are more consistent than, say, english-literature.

Maybe the same can be said about Scala vs. Java. The latter has many inconsistencies, but also a thin layer of abstraction.




i4mfjYzPLWbo7GRDZyJqZUbW8yHRouOH8CFT8RcgPJA [at] mail [dot] gmail [dot] com" type="cite">

-----Original Message-----
From: Richard Wallace [rwallace [at] thewallacepack [dot] net (mailto:rwallace [at] thewallacepack [dot] net)]
Sent: October-27-11 2:12 PM
To: Razvan Cojocaru
Cc: HamsterofDeath; scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

On Thu, Oct 27, 2011 at 10:41 AM, Razvan Cojocaru pub [at] razie [dot] com (<pub [at] razie [dot] com>) wrote:
Well, since it’s now a debate and seriously derailed (I’m seriously
sorry about that serious problem), I found out (thanks, Daniel) that
*->*->* actually stands for something: it’s the “kind of a  binary
type constructor”.



So that particular trait’s name has a meaning…



Otherwise, my translation of that code stands as below:
http://pastie.org/2742209



First, the names need decoding:

F[_,_] is like a Map [A,B] in any reasonable language: it's a type
parametrized in two other types, we'll call it SomeMap.
Nope.  F[_, _] is any type constructor that takes 2 types as parameters.
This _could_be_ Map, but doesn't have to be.  Other types that would work
are Either, EitherT[_, F, _], State, StateT[_, F, _], Reader, Kleisli[_, F,
_] (also known as ReaderT[_, F, _]), and other computations that you may
want to compose.  It has nothing to do with Maps in particular, except that
Map happens to also be a Function1 which, oh look, has 2 type parameters!

Rich

A and B are any ordinary types.

The name of the implicit should be irrelevant, since its' well - implicit!

The *->*->* class, which is missing, looks like a MapPimp - it wraps
maps for whatever reason, maybe to add new methods to it (i.e. pimp
it). a and b are probably typing errors, we'll correct that. using
value for member is nasty, will replace with "pimped"

The *->*->** trait here is meant to be mixed into a class, in which
class, the implicit will automatically wrap any map of any two types A
and B into a MapPimp and will probably add new methods - this is the
"pimping pattern"
classical in scala.

With all this, the nasty code

trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
*->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }

becomes the trait MapHelper in the full sample here:
http://pastie.org/2742209





From: scala-debate [at] googlegroups [dot] com
[scala-debate [at] googlegroups [dot] com (mailto:scala-debate [at] googlegroups [dot] com)]
On Behalf Of HamsterofDeath
Sent: October-27-11 12:59 PM
To: scala-debate [at] googlegroups [dot] com

Subject: Re: [scala-debate] Re: [scala-user] White Elefant



even after fixing the b to B, it doesn't compile. where does "*->*->*"
come from? the trait's name is *->*->**. i am not familiar with these
-> and *-stuff, so i don't know what it's supposed to do. maybe if it
would compile.

Am 27.10.2011 18:43, schrieb Peter C. Chapin:

Are you talking about the lower case b in F[A, b]? I figured it was
probably supposed to be F[A, B] but who knows… maybe there is a type ‘b’
in scope.


Peter



From: Rex Kerr [ichoran [at] gmail [dot] com (mailto:ichoran [at] gmail [dot] com)]
Sent: Thursday, October 27, 2011 12:16
To: Chapin, Peter @ VTC
Cc: scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant



Do you see the typo, then? :)

  --Rex

P.S. I'm almost positive it is a typo, but without more context I
can't be 100% sure.

On Thu, Oct 27, 2011 at 7:15 AM, Peter C. Chapin PChapin [at] vtc [dot] vsc [dot] edu (<PChapin [at] vtc [dot] vsc [dot] edu>)
wrote:

Ok, I’m starting to feel scared. That code actually looks fairly
understandable to me.



Peter



From: scala-debate [at] googlegroups [dot] com
[scala-debate [at] googlegroups [dot] com (mailto:scala-debate [at] googlegroups [dot] com)]
On Behalf Of Razvan Cojocaru
Sent: Wednesday, October 26, 2011 13:38
To: 'martin odersky'
Cc: 'Kevin Wright'; 'scala-debate'
Subject: RE: [scala-debate] Re: [scala-user] White Elefant





trait *->*->** { implicit def *->*->** [A, F[_,_], B](a: F[A,b]):
*->*->*[A, F, B] = new *->*->*[A, F, B] { val value = a } }









etorreborre 2
Joined: 2011-02-23,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.
Eric.

Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant
On 10/28/2011 09:37 AM, etorreborre wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.
Eric.

*->* smooch *<-*

-- 
Tony Morris
http://tmorris.net/

Stefan Zeiger
Joined: 2008-12-21,
User offline. Last seen 27 weeks 3 days ago.
Re: Re: White Elefant
On 2011-10-28 1:37, etorreborre wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.

I'd be happy with first-class support for type constructors, e.g.

trait Foo[A, B, C] { ... }

type X[A, B] = ({ type L[C] = Foo[A, B, C] })#L

-sz
Jesper Nordenberg
Joined: 2008-12-27,
User offline. Last seen 42 years 45 weeks ago.
Re: White Elefant

Stefan Zeiger skrev 2011-10-28 10:23:
> On 2011-10-28 1:37, etorreborre wrote:
>> Time to propose a new SIP: F[*, G, *] means ({type λ[α, β] = F[α, G,
>> β]})#λ.
>
> I'd be happy with first-class support for type constructors, e.g.
>
> trait Foo[A, B, C] { ... }
>
> type X[A, B] = ({ type L[C] = Foo[A, B, C] })#L

It's not much more compact than:

trait X[A, B] { type L[C] = Foo[A, B, C] }
foo[X[A, B]#L]

/Jesper Nordenberg

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant
That does have runtime cost of a generated class.  the type one doesn't.

On Fri, Oct 28, 2011 at 11:38 AM, Jesper Nordenberg <megagurka [at] yahoo [dot] com> wrote:
Stefan Zeiger skrev 2011-10-28 10:23:
On 2011-10-28 1:37, etorreborre wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G,
β]})#λ.

I'd be happy with first-class support for type constructors, e.g.

trait Foo[A, B, C] { ... }

type X[A, B] = ({ type L[C] = Foo[A, B, C] })#L

It's not much more compact than:

trait X[A, B] { type L[C] = Foo[A, B, C] }
foo[X[A, B]#L]

/Jesper Nordenberg


Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant
I think I would have prefered ? or _? being used for existential types.  However, remember that whatever you pick for type lambdas, you *cannot* be used as a type.  So, taking * means that we can no longer use it as a 'type operator'.  
Still, it'd make a good SIP, why not submit a proposal?

On Thu, Oct 27, 2011 at 7:37 PM, etorreborre <etorreborre [at] gmail [dot] com> wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.
Eric.


Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant
I don't see this as being widely used to deserve its own little corner in the language spec

Thanks,Razvan
On 2011-10-28, at 11:42 AM, Josh Suereth <joshua [dot] suereth [at] gmail [dot] com> wrote:

I think I would have prefered ? or _? being used for existential types.  However, remember that whatever you pick for type lambdas, you *cannot* be used as a type.  So, taking * means that we can no longer use it as a 'type operator'.  
Still, it'd make a good SIP, why not submit a proposal?

On Thu, Oct 27, 2011 at 7:37 PM, etorreborre <etorreborre [at] gmail [dot] com> wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.
Eric.


H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: White Elefant

what exactly does that mean?
if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]


H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: White Elefant
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
25mx7YcCDE__0LF3YwkfOpkj_PB+5WQ [at] mail [dot] gmail [dot] com" type="cite">A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]



H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: White Elefant
so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?

Am 28.10.2011 19:17, schrieb Josh Suereth:
CAFLqJkwrowhUb_ymZfzpWhj5TWqXj6Naf_2MgnSkdx+DYiJ5pQ [at] mail [dot] gmail [dot] com" type="cite">that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de" target="_blank" rel="nofollow">h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]





Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant
that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]




H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: White Elefant
this time it's a yes :D

it's kind of like a macro in clojure, just for types instead of code.

  type Magic[T] = List[(String, T)]
 
  val x:Magic[Number] = List(("",5))

everything is making sense now.

Am 28.10.2011 19:25, schrieb Josh Suereth:
CAFLqJkw2KBnRi0wg_z5tZQf9BWH6iD0s6a6j80GXa4HenU7fuQ [at] mail [dot] gmail [dot] com" type="cite"> trait Foo[T,V,U] type L[C] = Foo[A,B,C] L[Int] // Foo[A,B,Int]

def Foo(x: String, y: String, z: String) def L(C: String) = Foo("A", "B", C) L("C")  //  Foo("A","B","C")

I hope that helps....  (Note: for functions you have "types" of arguments.   In type-functions you have 'kinds" of arguments, but we don't directly represent those in scala).


On Fri, Oct 28, 2011 at 1:21 PM, HamsterofDeath <h-star [at] gmx [dot] de" rel="nofollow">h-star [at] gmx [dot] de> wrote:
so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?

Am 28.10.2011 19:17, schrieb Josh Suereth:
that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de" target="_blank" rel="nofollow">h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de" target="_blank" rel="nofollow">h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]







Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: White Elefant
trait Foo[T,V,U]type L[C] = Foo[A,B,C]L[Int] // Foo[A,B,Int]

def Foo(x: String, y: String, z: String)def L(C: String) = Foo("A", "B", C)L("C")  //  Foo("A","B","C")

I hope that helps....  (Note: for functions you have "types" of arguments.   In type-functions you have 'kinds" of arguments, but we don't directly represent those in scala).


On Fri, Oct 28, 2011 at 1:21 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?

Am 28.10.2011 19:17, schrieb Josh Suereth:
that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]






Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant
Type curry ?

Thanks,Razvan
On 2011-10-28, at 1:25 PM, Josh Suereth <joshua [dot] suereth [at] gmail [dot] com> wrote:

trait Foo[T,V,U]type L[C] = Foo[A,B,C]L[Int] // Foo[A,B,Int]

def Foo(x: String, y: String, z: String)def L(C: String) = Foo("A", "B", C)L("C")  //  Foo("A","B","C")

I hope that helps....  (Note: for functions you have "types" of arguments.   In type-functions you have 'kinds" of arguments, but we don't directly represent those in scala).


On Fri, Oct 28, 2011 at 1:21 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?

Am 28.10.2011 19:17, schrieb Josh Suereth:
that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]






Tony Morris
Joined: 2008-12-19,
User offline. Last seen 30 weeks 4 days ago.
Re: Re: White Elefant

But if you widely used it like a lot of us do...

On 29/10/2011 2:05 AM, "Razvan Cojocaru" <pub [at] razie [dot] com> wrote:
I don't see this as being widely used to deserve its own little corner in the language spec

Thanks,Razvan
On 2011-10-28, at 11:42 AM, Josh Suereth <joshua [dot] suereth [at] gmail [dot] com> wrote:

I think I would have prefered ? or _? being used for existential types.  However, remember that whatever you pick for type lambdas, you *cannot* be used as a type.  So, taking * means that we can no longer use it as a 'type operator'.  
Still, it'd make a good SIP, why not submit a proposal?

On Thu, Oct 27, 2011 at 7:37 PM, etorreborre <etorreborre [at] gmail [dot] com> wrote:
Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.
Eric.


Tony Morris
Joined: 2008-12-19,
User offline. Last seen 30 weeks 4 days ago.
Re: Re: White Elefant

It's no different to usual partial application, but on type constructor functions instead of regular function values.

On 29/10/2011 3:33 AM, "HamsterofDeath" <h-star [at] gmx [dot] de> wrote:
this time it's a yes :D

it's kind of like a macro in clojure, just for types instead of code.

  type Magic[T] = List[(String, T)]
 
  val x:Magic[Number] = List(("",5))

everything is making sense now.

Am 28.10.2011 19:25, schrieb Josh Suereth:
trait Foo[T,V,U] type L[C] = Foo[A,B,C] L[Int] // Foo[A,B,Int]

def Foo(x: String, y: String, z: String) def L(C: String) = Foo("A", "B", C) L("C")  //  Foo("A","B","C")

I hope that helps....  (Note: for functions you have "types" of arguments.   In type-functions you have 'kinds" of arguments, but we don't directly represent those in scala).


On Fri, Oct 28, 2011 at 1:21 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?

Am 28.10.2011 19:17, schrieb Josh Suereth:
that's a no.  
L[C] is a *type function*.   L is the name, C is the parameter.
L[Int] = Foo[A,B,Int]
L[List[Int] = Foo[A,B,List[Int]]
- Josh
On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
is that a yes?

Am 28.10.2011 19:04, schrieb Josh Suereth:
A and B have to be types defined eleswhere.
On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath <h-star [at] gmx [dot] de> wrote:
what exactly does that mean?
 if L = foo and C = A, B and C?

Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
> type L[C] = Foo[A, B, C]







Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Well, in that case… I mean, yeah…

 

But can we call F SomeMapLikeThing ?

 

From: tonymorris [at] gmail [dot] com [mailto:tonymorris [at] gmail [dot] com] On Behalf Of Tony Morris
Sent: October-28-11 4:17 PM
To: Razvan Cojocaru
Cc: scala-debate [at] googlegroups [dot] com; Josh Suereth; HamsterofDeath
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

 

But if you widely used it like a lot of us do...

On 29/10/2011 2:05 AM, "Razvan Cojocaru" <pub [at] razie [dot] com> wrote:

I don't see this as being widely used to deserve its own little corner in the language spec

Thanks,

Razvan


On 2011-10-28, at 11:42 AM, Josh Suereth <joshua [dot] suereth [at] gmail [dot] com> wrote:

I think I would have prefered ? or _? being used for existential types.  However, remember that whatever you pick for type lambdas, you *cannot* be used as a type.  So, taking * means that we can no longer use it as a 'type operator'.  

 

Still, it'd make a good SIP, why not submit a proposal?

On Thu, Oct 27, 2011 at 7:37 PM, etorreborre <etorreborre [at] gmail [dot] com> wrote:

Time to propose a new SIP:  F[*, G, *]  means ({type λ[α, β] = F[α, G, β]})#λ.

 

Eric.

 

 

 

Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

2011/10/28 Razvan Cojocaru :
> Well, in that case... I mean, yeah...
>
>
>
> But can we call F SomeMapLikeThing ?
>

No, because it doesn't have to be map like at all. Didn't we go over
this already?

>
>
> From: tonymorris [at] gmail [dot] com [mailto:tonymorris [at] gmail [dot] com] On Behalf Of Tony
> Morris
> Sent: October-28-11 4:17 PM
> To: Razvan Cojocaru
> Cc: scala-debate [at] googlegroups [dot] com; Josh Suereth; HamsterofDeath
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> But if you widely used it like a lot of us do...
>
> On 29/10/2011 2:05 AM, "Razvan Cojocaru" wrote:
>
> I don't see this as being widely used to deserve its own little corner in
> the language spec
>
> Thanks,
>
> Razvan
>
> On 2011-10-28, at 11:42 AM, Josh Suereth wrote:
>
> I think I would have prefered ? or _? being used for existential types.
> However, remember that whatever you pick for type lambdas, you *cannot* be
> used as a type. So, taking * means that we can no longer use it as a 'type
> operator'.
>
>
>
> Still, it'd make a good SIP, why not submit a proposal?
>
> On Thu, Oct 27, 2011 at 7:37 PM, etorreborre wrote:
>
> Time to propose a new SIP: F[*, G, *] means ({type λ[α, β] = F[α, G,
> β]})#λ.
>
>
>
> Eric.
>
>
>
>
>
>

Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

Pretty much. It's no different to regular partial application, but on
type constructor functions instead of value-level functions.

On 29/10/11 05:18, Razvan Cojocaru wrote:
> Type curry ?
>
> Thanks,
> Razvan
>
> On 2011-10-28, at 1:25 PM, Josh Suereth wrote:
>
>> trait Foo[T,V,U]
>> type L[C] = Foo[A,B,C]
>> L[Int] // Foo[A,B,Int]
>>
>> def Foo(x: String, y: String, z: String)
>> def L(C: String) = Foo("A", "B", C)
>> L("C") // Foo("A","B","C")
>>
>>
>> I hope that helps.... (Note: for functions you have "types" of arguments. In type-functions you have 'kinds" of arguments, but we don't directly represent those in scala).
>>
>>
>>
>> On Fri, Oct 28, 2011 at 1:21 PM, HamsterofDeath wrote:
>> so you "apply" C to the "function" L and get Foo[A,B,C] as a result type?
>>
>> Am 28.10.2011 19:17, schrieb Josh Suereth:
>>> that's a no.
>>>
>>> L[C] is a *type function*. L is the name, C is the parameter.
>>>
>>> L[Int] = Foo[A,B,Int]
>>>
>>> L[List[Int] = Foo[A,B,List[Int]]
>>>
>>> - Josh
>>>
>>> On Fri, Oct 28, 2011 at 1:15 PM, HamsterofDeath wrote:
>>> is that a yes?
>>>
>>> Am 28.10.2011 19:04, schrieb Josh Suereth:
>>>> A and B have to be types defined eleswhere.
>>>>
>>>> On Fri, Oct 28, 2011 at 1:03 PM, HamsterofDeath wrote:
>>>> what exactly does that mean?
>>>> if L = foo and C = A, B and C?
>>>>
>>>> Am 28.10.2011 17:38, schrieb Jesper Nordenberg:
>>>>> type L[C] = Foo[A, B, C]
>>>>
>>>
>>

Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.
RE: Re: White Elefant

Well, you are right - F is shorter... but if I *widely* use it, it could be very map like, more not than often... so I want to be able to call it a very wide JavaLike name...

Would a smiley sweeten the deal?

:)

Anyways, whichever way we go about naming F, I want co-founder rights on this ! I helped derail the discussion in this direction...

-----Original Message-----
From: Richard Wallace [mailto:rwallace [at] thewallacepack [dot] net]
Sent: October-28-11 4:45 PM
To: Razvan Cojocaru
Cc: Tony Morris; scala-debate [at] googlegroups [dot] com
Subject: Re: [scala-debate] Re: [scala-user] White Elefant

2011/10/28 Razvan Cojocaru :
> Well, in that case... I mean, yeah...
>
>
>
> But can we call F SomeMapLikeThing ?
>

No, because it doesn't have to be map like at all. Didn't we go over this already?

>
>
> From: tonymorris [at] gmail [dot] com [mailto:tonymorris [at] gmail [dot] com] On Behalf Of
> Tony Morris
> Sent: October-28-11 4:17 PM
> To: Razvan Cojocaru
> Cc: scala-debate [at] googlegroups [dot] com; Josh Suereth; HamsterofDeath
> Subject: Re: [scala-debate] Re: [scala-user] White Elefant
>
>
>
> But if you widely used it like a lot of us do...
>
> On 29/10/2011 2:05 AM, "Razvan Cojocaru" wrote:
>
> I don't see this as being widely used to deserve its own little corner
> in the language spec
>
> Thanks,
>
> Razvan
>
> On 2011-10-28, at 11:42 AM, Josh Suereth wrote:
>
> I think I would have prefered ? or _? being used for existential types.
> However, remember that whatever you pick for type lambdas, you
> *cannot* be used as a type. So, taking * means that we can no longer
> use it as a 'type operator'.
>
>
>
> Still, it'd make a good SIP, why not submit a proposal?
>
> On Thu, Oct 27, 2011 at 7:37 PM, etorreborre wrote:
>
> Time to propose a new SIP: F[*, G, *] means ({type λ[α, β] = F[α, G,
> β]})#λ.
>
>
>
> Eric.
>
>
>
>
>
>

Cédric Beust ♔
Joined: 2011-06-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: White Elefant

On Fri, Oct 28, 2011 at 2:15 PM, Razvan Cojocaru <pub [at] razie [dot] com> wrote:
Well, you are right - F is shorter... but if I *widely* use it, it could be very map like, more not than often... so I want to be able to call it a very wide JavaLike name...

It's a type constructor that takes two types in parameter, the fact that Map happens to have that signature is a coincidence. You don't have to call it F, but one letter names are typical for this kind of situation (uppercase in Scala, lowercase in Haskell).
-- Cédric




Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland