SlideShare a Scribd company logo
Submit Search
Upload
Jfokus functional groovy
Report
Andres Almiray
Software Developer, Open Source advocate
Follow
•
13 likes
•
1,235 views
1
of
31
Jfokus functional groovy
•
13 likes
•
1,235 views
Download Now
Download to read offline
Report
Andres Almiray
Software Developer, Open Source advocate
Follow
Recommended
Javaone - Getting Funky with Groovy
Andres Almiray
2.8K views
•
43 slides
Functional Groovy - Confess
Andres Almiray
2.5K views
•
44 slides
Notes: Verilog Part 5 - Tasks and Functions
Jay Baxi
1.5K views
•
2 slides
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
Jay Baxi
1.7K views
•
4 slides
Notes: Verilog Part 4- Behavioural Modelling
Jay Baxi
1.9K views
•
6 slides
Java.util.concurrent.concurrent hashmap
Srinivasan Raghvan
1.1K views
•
14 slides
More Related Content
What's hot
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Dierk König
1.4K views
•
24 slides
At Last an OCL Debugger
Edward Willink
861 views
•
16 slides
Closures
prashanthbabu07
270 views
•
16 slides
Safe navigation in OCL
Edward Willink
772 views
•
23 slides
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Jay Baxi
1.4K views
•
6 slides
Frege Tutorial at JavaOne 2015
Dierk König
1.7K views
•
59 slides
What's hot
(20)
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Dierk König
•
1.4K views
At Last an OCL Debugger
Edward Willink
•
861 views
Closures
prashanthbabu07
•
270 views
Safe navigation in OCL
Edward Willink
•
772 views
Notes: Verilog Part 2 - Modules and Ports - Structural Modeling (Gate-Level M...
Jay Baxi
•
1.4K views
Frege Tutorial at JavaOne 2015
Dierk König
•
1.7K views
Java 8 – completion stage
Fahad Cv
•
362 views
OCL 2.4. (... 2.5)
Edward Willink
•
812 views
Demystifying functional effect systems in Scala
Dmitry Karlinsky
•
343 views
Asynchronous Programming in C# - Part 1
Mindfire Solutions
•
2.1K views
QVT Traceability: What does it really mean?
Edward Willink
•
947 views
Concurrency with side-effects – cats way
stasimus
•
1.2K views
The JavaScript You Wished You Knew
Troy Miles
•
277 views
15 anonymous methods, partial types and nullable types
Tuan Ngo
•
675 views
Command line-arguments-in-java-tutorial
Kuntal Bhowmick
•
1.9K views
Instrumenting Go (Gopherconindia Lightning talk by Bhasker Kode)
Bhasker Kode
•
782 views
Swift, a quick overview
Julian Król
•
1.4K views
Fork/Join for Fun and Profit!
Sander Mak (@Sander_Mak)
•
1.7K views
FregeDay: Roadmap for resolving differences between Haskell and Frege (Ingo W...
Dierk König
•
2.1K views
FregeFX - JavaFX with Frege, a Haskell for the JVM
Dierk König
•
713 views
Viewers also liked
Gr8conf Flying with Griffon
Andres Almiray
589 views
•
16 slides
Øredev 09 - Introduction to Groovy
Andres Almiray
471 views
•
39 slides
Groovy AST Demyistified - 33degree
Andres Almiray
1.4K views
•
45 slides
A Walkthrough of Groovy AST Transformations
Andres Almiray
688 views
•
26 slides
Eclipsecon08 Introduction To Groovy
Andres Almiray
1.2K views
•
55 slides
Java Libraries You Can’t Afford to Miss
Andres Almiray
4.5K views
•
65 slides
Viewers also liked
(6)
Gr8conf Flying with Griffon
Andres Almiray
•
589 views
Øredev 09 - Introduction to Groovy
Andres Almiray
•
471 views
Groovy AST Demyistified - 33degree
Andres Almiray
•
1.4K views
A Walkthrough of Groovy AST Transformations
Andres Almiray
•
688 views
Eclipsecon08 Introduction To Groovy
Andres Almiray
•
1.2K views
Java Libraries You Can’t Afford to Miss
Andres Almiray
•
4.5K views
Similar to Jfokus functional groovy
The GO Language : From Beginners to Gophers
Alessandro Sanino
384 views
•
55 slides
Java 9 features
shrinath97
121 views
•
24 slides
Bring the fun back to java
ciklum_ods
640 views
•
32 slides
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
833 views
•
23 slides
Future Programming Language
YLTO
1K views
•
29 slides
Designing Better API
Kaniska Mandal
472 views
•
8 slides
Similar to Jfokus functional groovy
(20)
The GO Language : From Beginners to Gophers
Alessandro Sanino
•
384 views
Java 9 features
shrinath97
•
121 views
Bring the fun back to java
ciklum_ods
•
640 views
"Xapi-lang For declarative code generation" By James Nelson
GWTcon
•
833 views
Future Programming Language
YLTO
•
1K views
Designing Better API
Kaniska Mandal
•
472 views
Ruby Presentation
platico_dev
•
6.2K views
G pars
NexThoughts Technologies
•
541 views
Understanding And Using Reflection
Ganesh Samarthyam
•
640 views
Andy On Closures
melbournepatterns
•
1.2K views
Native Java with GraalVM
Sylvain Wallez
•
1K views
imperative programming language, java, android
i i
•
190 views
What is Java Technology (An introduction with comparision of .net coding)
Shaharyar khan
•
1.1K views
Annotations
Knoldus Inc.
•
8.8K views
What's new in Scala and the Scala IDE for Eclipse for 2.8.0
Miles Sabin
•
404 views
Whoops! Where did my architecture go?
Oliver Gierke
•
7.1K views
Java for Mainframers
Rich Helton
•
1.4K views
What's New in Groovy 1.6?
Guillaume Laforge
•
697 views
Daggerate your code - Write your own annotation processor
Bartosz Kosarzycki
•
1.4K views
Javascript
Sheldon Abraham
•
336 views
More from Andres Almiray
OracleDB Ecosystem for Java Developers
Andres Almiray
13 views
•
48 slides
Softcon.ph - Maven Puzzlers
Andres Almiray
5 views
•
37 slides
Maven Puzzlers
Andres Almiray
49 views
•
37 slides
Oracle Database Ecosystem for Java Developers
Andres Almiray
44 views
•
33 slides
JReleaser - Releasing at the speed of light
Andres Almiray
394 views
•
31 slides
Building modular applications with the Java Platform Module System and Layrry
Andres Almiray
292 views
•
50 slides
More from Andres Almiray
(20)
OracleDB Ecosystem for Java Developers
Andres Almiray
•
13 views
Softcon.ph - Maven Puzzlers
Andres Almiray
•
5 views
Maven Puzzlers
Andres Almiray
•
49 views
Oracle Database Ecosystem for Java Developers
Andres Almiray
•
44 views
JReleaser - Releasing at the speed of light
Andres Almiray
•
394 views
Building modular applications with the Java Platform Module System and Layrry
Andres Almiray
•
292 views
Going Reactive with g rpc
Andres Almiray
•
142 views
Building modular applications with JPMS and Layrry
Andres Almiray
•
193 views
Taking Micronaut out for a spin
Andres Almiray
•
644 views
Apache Groovy's Metaprogramming Options and You
Andres Almiray
•
718 views
What I wish I knew about Maven years ago
Andres Almiray
•
425 views
What I wish I knew about maven years ago
Andres Almiray
•
1K views
The impact of sci fi in tech
Andres Almiray
•
210 views
Gradle Ex Machina - Devoxx 2019
Andres Almiray
•
490 views
Creating Better Builds with Gradle
Andres Almiray
•
239 views
Interacting with the Oracle Cloud Java SDK with Gradle
Andres Almiray
•
796 views
Gradle ex-machina
Andres Almiray
•
557 views
Go Java, Go!
Andres Almiray
•
866 views
Going Reactive with gRPC
Andres Almiray
•
2.4K views
The JavaFX Ecosystem
Andres Almiray
•
933 views
Jfokus functional groovy
1.
FUNCTIONAL GROOVY ANDRES ALMIRAY CANOO ENGINEERING
A.G. @AALMIRAY
2.
ABOUT THE SPEAKER Java
developer since the beginning True believer in open source Groovy committer since 2007 Project lead of the Griffon framework Currently working for
4.
FUNCTIONAL GROOVY, ARE YOU KIDDING ME?
5.
GROOVY IS NOT HASKELL
RUSSEL WINDER
6.
CLOSURES == FUNCTIONS Closures
are functions (i.e, blocks of code) with an environment containing a binding for all free variables of the function
7.
CLOSURES == FUNCTIONS Closures
are NOT side effect free by design
8.
CLOSURES: PARAMETERS (1) Parameter
types may be omitted if type information is not needed
9.
CLOSURES: PARAMETERS (2) Parameters
may have default values NOTE: Default values must be defined from right to left
10.
CLOSURES: DEFAULT PARAMETER Closures may
have a default parameter named it
11.
CLOSURES LEAD TO
… Partial Evaluation Composition Memoization Tail calls Iterators Streams
12.
PARTIAL EVALUATION (1) Currying
creates a new closure with fixed parameters, left to right
13.
PARTIAL EVALUATION (2) Currying
may be applied right to left too, even on an arbitrary index
14.
COMPOSITION (1) Closures may
be composed (left to right) using the >> operator
15.
COMPOSITION (2) Closures may
be composed (right to left) using the << operator
16.
MEMOIZATION Cache computed values
for increased performance
17.
TAIL CALLS (1) Recursive
closures may use Tail Calls thanks to trampoline()
18.
TAIL CALLS (2) Apply
@TailRecursive on methods https://github.com/jlink/tailrec/
19.
ITERATORS (1)
20.
ITERATORS (2) p
21.
ITERATORS
22.
OBJECTS AS PARTIAL
EVALS Any class may implement the call() method, enabling implicit evaluation
23.
METHODS AS CLOSURES Any
method may be transformed to a Closure using the .& operator
24.
STREAMS (1) Lazy generators.
Extension module created by @tim_yates http://timyates.github.com/groovy-stream/
25.
STREAMS (2) Groovy is
Java friendly. Usa any Java library such as functional-java
26.
IMMUTABILITY The @Immutable AST
transformation makes writing immutable classes trivial
27.
GPARS http://gpars.codehaus.org/ Concurrent collection
processing Composable asynchronous functions Fork/Join abstraction Actor programming model Dataflow concurrency constructs CSP Agent - an thread-safe reference to mutable state
28.
PARALLEL COLLECTIONS Gpars enhances
JDK/GDK collections with parallel execution enabled versions
29.
RESOURCES • http://pragprog.com/magazines/2013-01/using-
memoization-in-groovy • http://www.ibm.com/developerworks/views/java/ libraryview.jsp?search_by=functional+thinking: • https://github.com/jlink/tailrec/ • http://timyates.github.com/groovy-stream/ • http://www.jroller.com/vaclav/ • http://gpars.codehaus.org/ • http://www.slideshare.net/arturoherrero/functional- programming-with-groovy
30.
Q&A
31.
THANK YOU!