functional reactive programming
TRANSCRIPT
DEV07Functional Reactive ProgrammingAlessandro Melchiori
[email protected] - @amelchiori
http://melkio.codiceplastico.com/
Grazie a
PlatinumSponsor
It's declarative, stateless, side-effects free and immutable
Functional programming
describes what we want, not how we want
it
It's declarative, stateless, side-effects free and immutable
Functional programming
describes what we want, not how we want
it
system relys only on inputs, not external
state
It's declarative, stateless, side-effects free and immutable
Functional programming
describes what we want, not how we want
it
system relys only on inputs, not external
state
once value has been set, we can't override its
value
Return new value, instead of altering
existing ones
let source = [ 1; 2; 3]
let result =
List.map (fun x -> x*2) source
val result : int list = [2; 4; 6]
map
let source = [ 1; 2; 3]
let result =
List.filter (fun x -> x > 1) source
val result : int list = [2; 3]
filter
let source = [ 1; 2; 3]
let result =
List.reduce (fun acc curr -> acc + curr) source
val result : int = 6
reduce
let source = [ [ 1; 2; 3]; [ 4; 5 ] ]
let result =
List.collect (fun x -> x) source
val result : int list = [1; 2; 3; 4; 5; 6]
collect
let source1 = [ 1; 2; 3]
let source2 = [‘A’;’B’;’C’]
let result =
List.zip source1 source2
val res : (int * char) list = [(1, 'A'); (2, 'B'); (3, 'C')]
zip
A programming paradigm oriented around data flows
and the propagation of change.
Reactive programming
Reactive systems are responsive, resilient, elastic and message driven
Reactive manifesto (http://www.reactivemanifesto.org/)
Reactive programming
Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators
(https://msdn.microsoft.com/en-us/data/gg577609.aspx)
Reactive extensions
Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators
(https://msdn.microsoft.com/en-us/data/gg577609.aspx)
Reactive extensions
Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators
(https://msdn.microsoft.com/en-us/data/gg577609.aspx)
Reactive extensions
Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators
(https://msdn.microsoft.com/en-us/data/gg577609.aspx)
Reactive extensions
Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators
(https://msdn.microsoft.com/en-us/data/gg577609.aspx)
Reactive extensions
• a set of types representing asynchronous data streams
• a set of operators to query asynchronous data streams
• a set of types to parameterize concurrency
Reactive extensions
The Observable type adds two missing semantics to the Gang of Four's Observer pattern, which are available in the Iterable type:
• The ability for the producer to signal to the consumer that there is no more data available
• The ability for the producer to signal to the consumer that an error has occurred
Reactive extensions
Q&A
Tutto il materiale di questa sessione suhttp://www.communitydays.it/
Lascia subito il feedback su questa sessione,potrai essere estratto per i nostri premi!
Seguici suTwitter @CommunityDaysITFacebook http://facebook.com/cdaysit#CDays15