usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
400 stars 77 forks source link

Composability #571

Closed sirinath closed 10 years ago

sirinath commented 10 years ago

There is 2 areas composability can improve 1) Composable patterns (similar to active patterns in F#, Pattern calculus / Bondi Language) 2) Composable function (similar to dots and concatenative programming)

Also support of currying (in many forms rcurry, lcurry, user specified partial application) as this will help functional compositions. E.g. I have a function (f1) taking 2 arguments which I want to join with two functions (f2 and f3) which return one value each. I can compose something like f3 . (f2 . f1)

Also support for tuple form for parameters where the tuple is one parameters and ability to compose tuples would be helpful in composing new functionality. Compose a tuple of application of f2 and f3 and pass this to f1 as in the above example. For consistent support for parameter names tuples should support both names and unnamed elements.

PaulKlint commented 10 years ago

We partly support what you ask for. Functions are defined using patterns and can be composed. They are invoked using pattern-based dispatch. We do not provide:

sirinath commented 10 years ago

It is possible for some one in the team to write some documentation.

sirinath commented 10 years ago

it is possible to add Dots (Tacit Programming, Point Free Programming) to the list of things to be implemented.

jurgenvinju commented 10 years ago

You can use the 'o' for function composition— Jurgen J. Vinju CWI SWAT INRIA Lille UvA master software engineering http://jurgen.vinju.org

On Fri, May 2, 2014 at 5:40 AM, Suminda Dharmasena notifications@github.com wrote:

It is possible for some one in the team to write some documentation.

Reply to this email directly or view it on GitHub: https://github.com/cwi-swat/rascal/issues/571#issuecomment-41983466

sirinath commented 10 years ago

OK Great.

Can we have more tutorials on this?

swatbot commented 10 years ago

There is no time for that now. Just try it on the console prompt! (F o G)(2)— Jurgen J. Vinju CWI SWAT INRIA Lille UvA master software engineering http://jurgen.vinju.org

On Fri, May 2, 2014 at 8:30 AM, Suminda Dharmasena notifications@github.com wrote:

OK Great.

Can we have more tutorials on this?

Reply to this email directly or view it on GitHub: https://github.com/cwi-swat/rascal/issues/571#issuecomment-41994969