Referential Transparency, Higher Order functions, Lazy Evaluation, and Pattern Matching are key concepts in Functional Programming. Referential Transparency means that equal expressions can be replaced with each other without changing the program's behavior. Higher Order functions allow functions to be passed as arguments to other functions and returned as results. Lazy Evaluation delays evaluating arguments until their values are needed to avoid unnecessary computation. Pattern Matching allows decomposing and analyzing data structures.
A tour of Python: slides from presentation given in 2012.
[Some slides are not properly rendered in SlideShare: the original is still available at http://www.aleksa.org/2015/04/python-presentation_7.html.]
"Немного о функциональном программирование в JavaScript" Алексей КоваленкоFwdays
Все началось давно, еще в школе, классе эдак 7. Тогда учитель математики впервые произнесла фразу: "Игрек равно эф от икс". В то время я и не догадывался что это самое "эф от икс", является базовым принципом функционального программирования, да и не только функционального.
Functional Programming, Reactive Programming, Transducers, MapReduce и многое другое, так или иначе корнями уходит в то самое, незамысловатое f(x). Это настолько серьезная часть программирования, что ежеминутно, если не ежесекундно, по всему миру на клавиатуре нажимаются клавиши f, u, n, c, t, i, o, n. И нажимаются они именно в этой последовательности.
Пора принять тот факт, что без функционального программирования, программирования не существует!
Пора разобраться. Пора понять для чего нужны функции в программирование, как они должны работать и чем они могут быть полезны в ежедневной работе.
Moore's Law may be dead, but CPUs acquire more cores every year. If you want to minimize response latency in your application, you need to use every last core - without wasting resources that would destroy performance and throughput. Traditional locks grind threads to a halt and are prone to deadlocks, and although actors provide a saner alternative, they compose poorly and are at best weakly-typed.
In this presentation, created exclusively for Scalar Conf, John reveals a new alternative to the horrors of traditional concurrency, directly comparing it to other leading approaches in Scala. Witness the beauty, simplicity, and power of declarative concurrency, as you discover how functional programming is the most practical solution to solving the tough challenges of concurrency.
Martin Fowler's Refactoring Techniques Quick ReferenceSeung-Bum Lee
Martin Fowler's Refactoring Techniques Summary. This includes categorization and simple descriptions as well as some sample code and class diagram for better understanding
Learn to manipulate strings in R using the built in R functions. This tutorial is part of the Working With Data module of the R Programming Course offered by r-squared.
For the past few years in the functional Scala community, the standard approach for adding features to an effect type (features like logging, stateful updates, or accessing config) has been Monad Transformers (EItherT, OptionT, WriterT, ReaderT, etc.).
While elegant and proven, monad transformers were imported directly from Haskell, and in Scala, they have poor ergonomics and poor performance. Using tagless-final on transformers can eliminate some of the boilerplate, but cannot improve performance, and tagless-final makes it insanely hard to locally introduce and eliminate features.
In this presentation, John will introduce an alternate approach he coined ‘effect rotation’, which shares most of the power of monad transformers, but with better ergonomics and no loss of performance. You will see how to use the ZIO library that John created to composably add different features into the ZIO effect type, to solve the same problems as monad transformers, but in a way that feels natural and idiomatic for Scala.
Kickstart your data science journey with this Python cheat sheet that contains code examples for strings, lists, importing libraries and NumPy arrays.
Find more cheat sheets and learn data science with Python at www.datacamp.com.
A tour of Python: slides from presentation given in 2012.
[Some slides are not properly rendered in SlideShare: the original is still available at http://www.aleksa.org/2015/04/python-presentation_7.html.]
"Немного о функциональном программирование в JavaScript" Алексей КоваленкоFwdays
Все началось давно, еще в школе, классе эдак 7. Тогда учитель математики впервые произнесла фразу: "Игрек равно эф от икс". В то время я и не догадывался что это самое "эф от икс", является базовым принципом функционального программирования, да и не только функционального.
Functional Programming, Reactive Programming, Transducers, MapReduce и многое другое, так или иначе корнями уходит в то самое, незамысловатое f(x). Это настолько серьезная часть программирования, что ежеминутно, если не ежесекундно, по всему миру на клавиатуре нажимаются клавиши f, u, n, c, t, i, o, n. И нажимаются они именно в этой последовательности.
Пора принять тот факт, что без функционального программирования, программирования не существует!
Пора разобраться. Пора понять для чего нужны функции в программирование, как они должны работать и чем они могут быть полезны в ежедневной работе.
Moore's Law may be dead, but CPUs acquire more cores every year. If you want to minimize response latency in your application, you need to use every last core - without wasting resources that would destroy performance and throughput. Traditional locks grind threads to a halt and are prone to deadlocks, and although actors provide a saner alternative, they compose poorly and are at best weakly-typed.
In this presentation, created exclusively for Scalar Conf, John reveals a new alternative to the horrors of traditional concurrency, directly comparing it to other leading approaches in Scala. Witness the beauty, simplicity, and power of declarative concurrency, as you discover how functional programming is the most practical solution to solving the tough challenges of concurrency.
Martin Fowler's Refactoring Techniques Quick ReferenceSeung-Bum Lee
Martin Fowler's Refactoring Techniques Summary. This includes categorization and simple descriptions as well as some sample code and class diagram for better understanding
Learn to manipulate strings in R using the built in R functions. This tutorial is part of the Working With Data module of the R Programming Course offered by r-squared.
For the past few years in the functional Scala community, the standard approach for adding features to an effect type (features like logging, stateful updates, or accessing config) has been Monad Transformers (EItherT, OptionT, WriterT, ReaderT, etc.).
While elegant and proven, monad transformers were imported directly from Haskell, and in Scala, they have poor ergonomics and poor performance. Using tagless-final on transformers can eliminate some of the boilerplate, but cannot improve performance, and tagless-final makes it insanely hard to locally introduce and eliminate features.
In this presentation, John will introduce an alternate approach he coined ‘effect rotation’, which shares most of the power of monad transformers, but with better ergonomics and no loss of performance. You will see how to use the ZIO library that John created to composably add different features into the ZIO effect type, to solve the same problems as monad transformers, but in a way that feels natural and idiomatic for Scala.
Kickstart your data science journey with this Python cheat sheet that contains code examples for strings, lists, importing libraries and NumPy arrays.
Find more cheat sheets and learn data science with Python at www.datacamp.com.
Using functional concepts in Python. Introduction to functional programming and exploring each of the concepts, like map, filter and reduce in detail and how functional programming can help creating massively parallel software systems
Python 101 language features and functional programmingLukasz Dynowski
Presentation reviles the syntax solution for common encountered programming challenges, gives insight in to python datatypes, and explains core design principles behind the program
This is a presentation which was presented on Innovecs Tech Hangout in Kiev June 2017.
Includes
- Pure Functions
- Currying
- Function Composition
- Functors
- Monads
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingIstanbul Tech Talks
Functional programming is finally a first class citizen in the Cocoa toolset! But, as you may have heard, Swift is not necessarily a pure functional language. And in embracing the functional paradigm, do you need to throw out your knowledge and experience with Object Oriented programming? Saul Mora shows that it turns out you can have your cake and eat it too!
Functional Programming for OO Programmers (part 2)Calvin Cheng
Code examples demonstrating Functional Programming concepts, with JavaScript and Haskell.
Part 1 can be found here - http://www.slideshare.net/calvinchengx/functional-programming-part01
Source code can be found here - http://github.com/calvinchengx/learnhaskell
Let me know if you spot any errors! Thank you! :-)
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
8. Referential Transparency
“Equals can be replaced
with equals”
http://2.bp.blogspot.com/_DS3VD3b2euI/TRIcIUzduDI/AAAAAAAAAGA/Xp2E6kPxZCc/s1600/Pascal+the+chameleon+from+tangled+rapunzel+disney+cartoon.jpg
11. public class ReferentiallyOpaque {
private int x = 0;
static int f(int y) {
return x += y;
}
public static void main(String[] args) {
ReferentiallyOpaque ro = new ReferentiallyOpaque();
System.out.println(ro.f(5));
System.out.println(ro.f(5));
}
}
12. public class ReferentiallyOpaque {
private int x = 0;;
static int f(int y) {
return x += y;
}
public static void main(String[] args) {
ReferentiallyOpaque ro = new ReferentiallyOpaque();
System.out.println(ro.f(5));
System.out.println(ro.f(5));
}
}
5
10
13. public class Example {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer("Hello World");
System.out.println(buffer.reverse());
System.out.println(buffer.reverse());
}
}
14. public class Example {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer("Hello World");
System.out.println(buffer.reverse());
System.out.println(buffer.reverse());
}
}
dlroW olleH
Hello World
15. public class Example {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer("Hello World");
StringBuffer s1 = buffer.reverse();
StringBuffer s2 = buffer.reverse();
System.out.println(s1 + " " + s2);
}
}
16. public class Example {
public static void main(String[] args) {
StringBuffer buffer = new StringBuffer("Hello World");
StringBuffer s1 = buffer.reverse();
StringBuffer s2 = buffer.reverse();
System.out.println(s1 + " " + s2);
}
}
Hello World Hello World
20. Looping
Recursion
static int factorial(int number) {
int f = 1;
for (int i = number; i > 0; i--)
f = f * i;
return f;
}
static int factorial(int number) {
return (number == 1) ?
number :
number * factorial(number - 1);
}
http://www.shrink4men.com/wp-content/uploads/2010/11/dog-chasing-its-tail.jpg
22. Modifying data
Immutable
static List<Integer> addToList(List<Integer> integers, int a) {
integers.add(a);
return integers;
}
let addToList list a =
list @ [a]
> let g = [1;2;3;];;
val g : int list = [1; 2; 3]
> addToList g 4;;
val it : int list = [1; 2; 3; 4]
> g;;
val it : int list = [1; 2; 3]
>
http://4.bp.blogspot.com/_RpRScqAI8e4/SbNPgumsqPI/AAAAAAAAAK4/ZK8ZsfKJCmQ/s400/wolverine+hugh+jackman.jpg
25. Higher Order functions
“Functions that can be passed as arguments”
def square(x):
return x * x
def add(function, x):
return function(x) + function(x)
print add(square, 5)
26. Higher Order functions
“Functions that can be returned as results”
function addNumber(x) {
return function(y) {
return x + y
}
}
var add4With = addNumber(4)
var add5With = addNumber(5)
add4with(8)
add5with(8)
12
13
27. Higher Order functions
“Functions that can be returned as results”
function addNumber(x) {
Lambda Functions
return function(y) {
return x + y
}
}
var add4With = addNumber(4)
var add5With = addNumber(5)
add4with(8)
add5with(8)
12
13
28. Higher Order functions
“Functions that can be returned as results”
function addNumber(x) {
Lambda Functions
return function(y) {
return x + y
}
}
var add4With = addNumber(4)
var add5With = addNumber(5)
add4with(8)
Functions stored in
add5with(8)
data structures
12
13
29. Higher Order functions
“Currying”
let add x y =
x + y
val add : int -> int -> int
> let add5 = add 5;;
val add5 : (int -> int)
> add5 4;;
val it : int = 9
>
31. Lazy Evaluation
“Arguments in a function call are evaluated at most once.”
http://www.arngren.dk/image/Wallpaper/Comic/Calvin%20Hobbes/Sleeping1024.jpg
32. Lazy Evaluation
“Ability to invoke expressions only when its value is needed.”
static void Main(string[] args)
{
var lazy = new Lazy<int>(() =>
{
Console.WriteLine("calculating...");
return 6 * 7;
});
Console.WriteLine(lazy.Value);
Console.WriteLine(lazy.Value);
}
33. Lazy Evaluation
“Ability to invoke expressions only when its value is needed.”
static void Main(string[] args)
{
var lazy = new Lazy<int>(() =>
{
Console.WriteLine("calculating...");
return 6 * 7;
});
Console.WriteLine(lazy.Value);
Console.WriteLine(lazy.Value);
}
calculating...
42
42
34. Lazy Evaluation
“Memoization”
function Lazy_Memoized(def) {
var cache = [];
return function(i) {
return (i in cache) ? cache[i] :
(cache[i] = def.call(arguments.callee, i));
};
}
var factorial = new Lazy_Memoized(function(i) {
return i <= 1 ? i : i * this(i - 1);
});
factorial(6)
35. Lazy Evaluation
“Ability to create infinite sequence in data structures”
http://softwarezku.co.cc/wp-content/uploads/2010/09/Visual-Studio-2010-Logo.png
39. Pattern Matching
A typical function definition
fac :: Integer -> Integer
fac 0 = 1
fac n | n > 0 = n * fac(n-1)
let rec factorial = function
| 0 -> 1
| n -> n * factorial(n - 1)
40.
41.
42. References
• Concepts, Evolution and Application of Functional Programming Languages – Paul
Hudak
• http://msdn.microsoft.com/en-us/library/dd547125.aspx - Pattern Matching in
F#
• http://appden.com/javascript/lazy-list-comprehensions-in-javascript-a-lazy-
evalution/
• http://images.google.com
• http://en.wikipedia.org
• http://www.haskell.org/haskellwiki/Haskell
• http://homepages.inf.ed.ac.uk/wadler/