polymorphism and macro->source

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

polymorphism and macro->source

Johann Borck
Hello all!

1. Is there any chance that higher-order/higher-kinded polymorphism will be part of haxe 3.0 or
later? So you could write a

class Foo<S, T<X>> {

}

There seems to be quite some interest in haxe as a functional language, and this feature would
certainly be very attractive for functional programmers. Besides being extremely useful, of course :)

2. Is there any way to convert the return value of a macro into source code? It would be a nice
feature for debugging complex macros and for code generation in general.

thanks for consideration,
Johann


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: polymorphism and macro->source

Juraj Kirchheim
> Hello all!
>
> 1. Is there any chance that higher-order/higher-kinded polymorphism will be
> part of haxe 3.0 or later? So you could write a
>
> class Foo<S, T<X>> {
>
> }

What is that supposed to mean? What is the role of this X? You can do
things like these:

   class Foo<X> {}
   class Bar < A, B:Foo<A> > {}

If that's what you're after?

> There seems to be quite some interest in haxe as a functional language, and
> this feature would certainly be very attractive for functional programmers.
> Besides being extremely useful, of course :)

Well, whatever this notation is meant to communicate, I can't seem to
understand it.
Maybe it can already be done, just in a different way?

> 2. Is there any way to convert the return value of a macro into source code?
> It would be a nice feature for debugging complex macros and for code
> generation in general.

I have this lying around half finished. Will try to complete it soon.

greetz
back2dos

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: polymorphism and macro->source

sledorze
Please, let me introduce you a nice paper explaining it.. :)

https://lirias.kuleuven.be/bitstream/123456789/186940/4/tcpoly.pdf

have fun.

Stephane
Reply | Threaded
Open this post in threaded view
|

Re: polymorphism and macro->source

laurence taylor
I've noticed that the type system can be a bit achey-breaky at times, don't know enough type theory to articulate it, so it's fairly mute at the moment.

On Tue, Jul 19, 2011 at 9:22 PM, sledorze <[hidden email]> wrote:
Please, let me introduce you a nice paper explaining it.. :)

https://lirias.kuleuven.be/bitstream/123456789/186940/4/tcpoly.pdf

have fun.

Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/polymorphism-and-macro-source-tp6590453p6599996.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: polymorphism and macro->source

sledorze
It is not so much, but requiers more annotations than haXe due to subtyping constraints and top down inference (from parameter types to the inner function).

That's saud higher kinded types can be used in several different type systems :)

On Tue, Jul 19, 2011 at 10:13 PM, laurence taylor [via Haxe] <[hidden email]> wrote:
I've noticed that the type system can be a bit achey-breaky at times, don't know enough type theory to articulate it, so it's fairly mute at the moment.

On Tue, Jul 19, 2011 at 9:22 PM, sledorze <[hidden email]> wrote:
Please, let me introduce you a nice paper explaining it.. :)

https://lirias.kuleuven.be/bitstream/123456789/186940/4/tcpoly.pdf

have fun.

Stephane

--
View this message in context: http://haxe.1354130.n2.nabble.com/polymorphism-and-macro-source-tp6590453p6599996.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


If you reply to this email, your message will be added to the discussion below:
http://haxe.1354130.n2.nabble.com/polymorphism-and-macro-source-tp6590453p6600137.html
To unsubscribe from polymorphism and macro->source, click here.



--
Stéphane Le Dorze

Tel: +33 (0) 6 08  76 70 15