-
Notifications
You must be signed in to change notification settings - Fork 3
Home
This project has been moved from http://code.google.com/p/fpiglet/. Some parts of the move (like GrovyDoc) still need to be moved over.
FUNctional Programming in Groovy. It will not make Groovy into Haskell but hopefully will lead to more FUN(ctional) coding. The goal of this project is to bring some of the power and beauty of functional programming into Groovy.
Fpiglet is my hobby project, but I hope I will become more than one guy passion at some point. It has been a late-night/weekend endeavor and I apologize for typos and somewhat chaotic documentation.
- (Implicitly) curried functions (CurriedFunctions will change the way you code!)
- Functional Types accompanied by libraries of (curried) functions:
- Maybe
- Either
- Lazy Functional Lists (FunList, ListFunctions)
- Functional concepts:
- Functor (FunctorPolymorphism)
- Applicative (ApplicativePolymorphism)
- Monad (MonadPolymorphism)
- Functional libraries based on the above concepts
- Monadic function library (MonadFunctions)
- Applicative function library
- Functor mapped functional List library (functional list library ListFunctions applied to other concepts):
- Function library for Groovy Lists (FunListToGroovyList)
- Function library for Strings (FunListToString)
- Function library for InputStream (LazyIO)
- [Expressions]:
- Monadic Comprehensions (MonadicComprehensions)
- Functional if-then-elseif-then-else chains
- Localized scope expressions
Functional Programming is a vast and the version number 0.1 was selected to signify that there is a lot of territory left to be explored.
At this point, I would like to see if there is much interest within Groovy community in more serious FP before continuing with Fpiglet 0.2.
Fpiglet is not about methods, it is about Closures. Method 'oriented' OO coding will be limited with Fpiglet. I believe that function composition is a much better concept than any 'fluent interface'.
Moving away from methods to closures has many benefits. Closures are 'pieces of code' and first-class language citizens. This allows Fpiglet to define higher level concepts which 'act' on these pieces of code. Functor, Applicative, and Monad can all be viewed as Combinator Libraries. These 'Libraries' not only 'act' on Closures, but are implemented as a bunch of Closures themselves.
Moving away from methods and taking FP, Combinator Library point of view yields cleaner and more polymorphic code.
Fpiglet is using Groovy 2.0 (but it should work fine on 1.8) and JUnit4.
Gruesome: Fpiglet source tree: ext/gruesome includes a slightly modified (and currently not forked) copy of https://github.com/mcandre/gruesome together with its own (FreeBSD) license file. Gruesome is a simplified version of QuickCheck Property-based Testing library ported to Groovy. (Integration of Property-based testing into Fpiglet is work in progress and will improve in the future).
Eclipse project file is included. If you prefer IDE agnostic build tool, gradle build file is included as well (GradleBuild).
- GettingStarted
- Project Overview
- Project Roadmap Wiki has short term goals and longer term ideas for Fpiglet.
- Recently started ProjectActivity log
- My blog: http://rpeszek.blogspot.com/
- Browse wiki pages (there is quite a few).
- GroovyDoc is still on code.google pages: http://fpiglet.googlecode.com/svn/tags/v0.1.00-release/docs/groovydoc/index.html.
Thanks for visiting.
Robert Peszek