GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mperry/functionalgroovy: Functional programming in Groovy

BranchesTags
Open more actions menu

Latest commit

 

History

483 Commits
483 Commits

Folders and files

NameName
Last commit message
Last commit date
base
base
 
 
consume
consume
 
 
core
core
 
 
demo
demo
 
 
gradle/wrapper
gradle/wrapper
 
 
java8
java8
 
 
kind
kind
 
 
main
main
 
 
sandbox
sandbox
 
 
test-extensions
test-extensions
 
 
typeclass
typeclass
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Functional Groovy

Functional Groovy is a library for doing functional programming (FP) in Groovy. It is a Groovy extension module for Functional Java (FJ), adding Groovy idioms and new FP constructs in Groovy.

Features includes:

  • FunctionalJava based
  • Enhances FunctionalJava for Groovy as a Groovy extension module
  • Groovy Quickcheck style property testing (specification based testing)
  • Monad library using a minimal monad implementation (unit/flatMap)
  • Monadic functions added to the standard Java List
  • Monad comprehensions (dynamically typed)
  • Lenses
  • Reader, Writer and State monads
  • A simple IO type
  • Y Combinator

The project has some cloud build servers I used to experiment with including:

  • Cloudbees Jenkins Build
  • Sonatype Functional Groovy Artifacts
  • Travis CI Build

I have written an initial blog post on Groovy Null Handling using Bind, Comprehensions and Lift covering:

  • some introductory material on functional programming in Groovy
  • how to begin using the Functional Groovy library
  • handling nulls by binding through the Option type, monadic comprehensions and monadic lifting

The full list of related posts are:

  • Groovy Null Handling Using Bind, Comprehensions and Lift
  • Specification Based Testing
  • Referentially Transparent Input/Output in Groovy
  • Folds and Unfolds

To start using the library add the dependency com.github.mperry:functionalgroovy-main:0.5.1-SNAPSHOT to your Gradle project. A simple test script to get going (test.groovy) is:

@GrabResolver('https://oss.sonatype.org/content/groups/public')
@Grab('com.github.mperry:functionalgroovy-core:0.5.1-SNAPSHOT')
@Grab('org.functionaljava:functionaljava:4.1')

import com.github.mperry.fg.*

1.to(5).each {
    println it
}

Run this script using groovy test.groovy.

This project uses:

  • JDK 8
  • Gradle 1.11
  • Groovy 2.3.2
  • Functional Java 4.1
  • Intellij Community Edition 13.1

I have added a list of open issues so feel free to contribute. Some ways of contributing are:

  • adding new functionality
  • adding tests
  • adding FP in Groovy examples
  • adding FunctionalGroovy usage examples

Functional Groovy is divided into four components: core, main, demo, java8 and consume.

  • Core enhances Functional Java with Groovy idioms
  • Main adds new functionality
  • Demo includes examples of FP in Groovy and usage of this library
  • Java8 includes enhancements related to Java 8 types (e.g. Optional).
  • Consume shows how to include FunctionalGroovy in your project

About

Functional programming in Groovy

Resources

Readme
Activity

Stars

70 stars

Watchers

9 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.