jdantonio / functional-ruby

A gem for adding functional programming tools to Ruby. Inspired by Erlang, Clojure, Haskell, and Functional Java.

Home Page:http://www.functional-ruby.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Roadmap

jdantonio opened this issue · comments

I started this gem just for fun; a way to experiment with functional programming ideas in Ruby. I don't really have a long-term plan or a very clear roadmap. Below is a list of features I would like to add as I find the time to work on them, but I (currently) am making no promises regarding if/when I will work on any of them.

I welcome any and all input from anyone actively using this gem. If you find this gem useful and have ideas for how it can grow and evolve I would love your feedback.

To-do

  • Declare Record classes with datatypes for all members (similar to PureScript)
  • Pure functional data structures based on finger trees
    • sequence
    • priority queue
    • search tree
    • priority search queue
  • Monoid
  • Pattern matching within if/elsif/else and case statements (based on Erlang and PureScript)
  • [ ] Support for RubyMotion
    • [ ] iOS
    • [ ] Android (once RubyMotion 3.0 is released)

Hi,

Any interest in adding currying ?

I have scratched the idea for a blog post, maybe I could help ; )

Thanks.

@rranelli Certainly, currying would be a great addition. Thank you! Have you already written the blog post? I'd love to read it.

Ow, the post is still a /core-dump/ of ideas. I will probably finish it this week.
My English is pretty poor so I tend to keep the posts way too long in the oven.

I'll let you know as soon as it becomes readable.

I'll get a proposal for currying them ;).

Thanks for attention!

I was surprised to learn just now that Proc#curry actually exists!

We could return a curryied version of a method with something like

def as_curry(name)
  method(name).to_proc.curry
end

Not sure how I would currify something like Array#map though. In functional languages the function to map over would be an actual argument, not a block.

I wasn't aware that Ruby supported currying. Nice find!

The behavior is also kinda weird.

add = (->(x,y) {x+y}).curry
add.().().().().(1).().(2) # => 3

For better or worse, ruby never ceases to amaze me.

@cvb I see that you created a v1.3.0 tag, but the version file still says 1.2.0 and that's the last version uploaded to Rubygems. Had you intended to release 1.3.0?

@jdantonio sorry, forgot that, think I also need to update changelog

and about rubygems, I don't know if I can do that, will try later

@cvb I can push to Rubygems when the release is ready. If you don't mind, please remove the 1.3.0 tag and create tag master again once you've updated the version file and the changelog. Normally I create a release within GitHub and upload the packaged ".gem" file before pushing to Rubygems. I can do the build if you like, but you are welcome to package the build yourself if you would prefer. There is a rake task for that. I can push the build to Rubygems once it's created.

@jdantonio ok, I updated and uploaded everything, I think you can upload it to rubygems now

I've published it to Rubygems. Thank you!