Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TDC Porto Alegre 2019 - JS Funcional com Ramda
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ana Luiza Portello
November 29, 2019
Programming
280
0
Share
TDC Porto Alegre 2019 - JS Funcional com Ramda
Ana Luiza Portello
November 29, 2019
More Decks by Ana Luiza Portello
See All by Ana Luiza Portello
FRONTIN | Elas Programam - Programação Funcional no Front-end
anabastos
0
130
Workshop JSFP - SEMCOMP 2021
anabastos
0
310
Clojure é um Java melhor que Java - Codecon 2021
anabastos
0
170
Clojure 101 - Criciuma Dev
anabastos
0
360
TDC POA - GraphQL
anabastos
1
300
BackEndSP - GraphQL
anabastos
0
270
Git & Github - RLadies
anabastos
1
270
Programaria Summit - Performance FrontEnd
anabastos
1
250
Programaria Summit - Performance Front-end
anabastos
0
200
Other Decks in Programming
See All in Programming
書き換えて学ぶTemporal #fukts
pirosikick
2
380
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
720
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
410
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
3.2k
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
0
170
Sans tests, vos agents ne sont pas fiables
nabondance
0
130
Are We Really Coding 10× Faster with AI?
kohzas
0
180
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
200
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
370
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
700
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Context Engineering - Making Every Token Count
addyosmani
9
890
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
For a Future-Friendly Web
brad_frost
183
10k
Writing Fast Ruby
sferik
630
63k
Skip the Path - Find Your Career Trail
mkilby
1
120
The World Runs on Bad Software
bkeepers
PRO
72
12k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
370
Mind Mapping
helmedeiros
PRO
1
190
Transcript
JS FUNCIONAL COM RAMDA
Olar! Meu nome é Ana Bastos Sou engenheira de software
no Nubank e cientista da computação pela PUC-SP. 2 anabastos @naluhh @anapbastos
3
Apresentar uma nova forma de pensar em JS e uma
possível ferramenta utilitária.
Muito tempo atrás… Que na verdade não é tanto tempo
atrás assim...
IndexOf 2009(ES5)
ver se um elementos está dentro de uma lista 2009(ES5)
None
!!~arr.indexOf(x)
Includes 2016(ES7)
loops js
map filter reduce forEach every some find
ABSTRAÇÕES Provêm ferramental com melhor valor algorítmico que pode salvar
linhas de código, tempo e bugs além de deixar as coisas mais legíveis.
HELPERS
ES6 ES7 ES8 ES9 ??????
RAMDA LODASH/FP
Bibliotecas pensadas para tornar mais fácil o javascript funcional
JS vem aos poucos adotando elementos de linguagens funcionais
Partial Application Pipeline operator Pattern Matching Flatmap PROPOSALS
RAMDA É DIFERENTE
DAY 0
Te força implementar conceitos funcionais direito de forma bonita e
bem fundamentada
IMUTABILIDADE
Pequenas funções puras reusáveis com apenas uma responsabilidade
SÓ FUNÇÕES
None
• Lists(map, filter, reduce, contains, replace, passAll, crop, flatten, find)
• Maths(inc, add, mean, sum) • String(split, replace) • Logics(equals, cond, not) • Relations(intersection, clamp, gt, lt) • Functions(curry, pipe, compose, ifElse, etc)
PQ PODE SER UMA BOA IDEIA?
Evita caca(Pureza / Mutabilidade) É mais produtivo(reuso) Ajuda a ler
codigo Ajuda muito a testar Faz muito sentido no front-end
Lida com undefineds / nulls
doSomething(obj.prop)
None
None
O PULO DO GATO
CURRY
None
TODA FUNCAO UNÁRIA
TODAS AS FUNCÕES SÃO CURRIED
None
None
None
Aplica os parametros da esquerda pra direita quando você tem
eles
PROPOSAL PARTIAL APPLICATION https://github.com/tc39/proposal-partial-application
None
A ordem dos argumentos são para facilitar o dado a
ser operado mais na direita
None
Funções <= Dado =>
Cond(Pattern Matching) If () { If () { if() {
if() { } } } Else { If () { } } }
Cond(Pattern Matching)
Cond(Pattern Matching)
PATTERN MATCHING PROPOSAL https://github.com/tc39/proposal-pattern-matching
Como se modela coisas?
PIPES
PIPELINE OPERATOR PROPOSAL https://github.com/tc39/proposal-pipeline-operator
function 1 function 2 INPUT OUTPUT OUTPUT
None
Composed Function INPUT OUTPUT
[5, 5, 4, 6] Média com ponto de participação deve
ser maior ou igual a 5
None
POINT-FREE PROGRAMMING
None
None
PIPE COMPOSE
None
HOF (Recompose)
PIPEP / COMPOSEP
then(a) .then(b) .then(c) .then(d)
await a() await b() await c() await d()
None
BIBLIOTECA DO FUTURO DO JS
HIGHLIGHTS
Perguntei pra amigos meus o que eles usam e as
respostas foram bem diferentes
APLICAÇÃO PARCIAL EM TESTES
EVOLVE APPLYSPEC DIFFERENCE UNIQ PROP
LENSES(Lidar com estado) MEMOIZATION(Lidar com recursão)
None
WARNINGS / APRENDIZADOS
• Cuidado com o RamdaScript • Legibilidade do projeto •
Anti-OpenSource • Isole o RamdaFucks(ramdaUtils)
COOKBOOK
• Rambda - github.com/selfrefactor/rambda • Ramda-fantasy - github.com/ramda/ramda-fantasy • Ramda
React Redux Patterns - tommmyy.github.io/ramda-react-redux-patterns/ • Thinking Ramda - randycoulman.com/blog/2016/05/24/thinking-in-ramda-gett ing-started • Ramda - Derek Stavis(Pagar.me talks) • Hey Underscore, You’re doing it wrong - Brian Lonsdorf.
Obrigada! anabastos @naluhh @anapbastos 81 speakerdeck.com/anabastos