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
Ana Luiza Portello
November 29, 2019
Programming
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
Clojure BR - Brazilian Utils: Simplificando o caos brasileiro com Clojure em uma biblioteca open source
anabastos
0
23
FRONTIN | Elas Programam - Programação Funcional no Front-end
anabastos
0
140
Workshop JSFP - SEMCOMP 2021
anabastos
0
310
Clojure é um Java melhor que Java - Codecon 2021
anabastos
0
180
Clojure 101 - Criciuma Dev
anabastos
0
370
TDC POA - GraphQL
anabastos
1
310
BackEndSP - GraphQL
anabastos
0
270
Git & Github - RLadies
anabastos
1
280
Programaria Summit - Performance FrontEnd
anabastos
1
260
Other Decks in Programming
See All in Programming
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
140
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
270
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.8k
共通化で考えるべきは、実装より公開する型だった
codeegg
0
250
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
550
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
150
Claude Team Plan導入・ガイド
tk3fftk
0
210
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
170
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
320
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
400
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
Design in an AI World
tapps
1
260
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
400
Java REST API Framework Comparison - PWX 2021
mraible
34
9.5k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Why Our Code Smells
bkeepers
PRO
340
58k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
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