Porque aprender haskellme fez um programador python melhor? @gustavopinto gustavo@entropie.com.br
Porque aprender haskellme fez um programador python melhor? Baseado em fatos reais @gustavopinto gustavo@e...
Gustavo Pinto2004 - belém, grad, php, sh2006 - amazontic, java, xp2008 - curitiba, msc, python2009 - aprio...
Belém
Belém
Belém
Belém
Belém
Belém
DISCLAIMER
Não tem código
Não tem código¬¬
Mentira, tem mas épouquinho :-)
1912 ~ 1954
1912 ~ 1954 1936
1912 ~ 1954 1936
ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THEENTSCHEIDUNGS PROBLEM
ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THEENTSCHEIDUNGS PROBLEM
ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THE DECISION PROBLEM
1903 ~1995
1903 ~1995 1936
1903 ~1995 1936
AN UNSOLVABLE PROBLEM OF ELEMENTARY NUMBER THEORY
1936
1936
Church-Turing thesis
Church-Turing thesis
Church-Turing thesis Equivalentes
Algumas features:● Pure functions● Functions as first-class objects● No side effects
Algumas features:● Pure functions● Functions as first-class objects● No side effects Concurrency ...
Great.. But, whatabout Python??
Python functional
Is python functional?
Is python functional?
I have never considered Python to be heavily influenced by functional languages, no matter what people say or thi...
I have never considered Python to be heavily influenced by functional languages, no matter what people say or thi...
I have never considered Python to be heavily influenced by functional languages, no matter what people say or thi...
I have never considered Python to be heavily influenced by functional languages, no matter what people say or thi...
I see list and functions
if god exists: atepassar**2hack, hack
search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
List comprehension A basic comprehension for a set that contains the first ten even natural numbers is The part before ...
List comprehension A basic comprehension for a set that contains the first ten even natural numbers is The part before ...
List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in ...
List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in ...
List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in ...
List Sou foda comprehension A basic comprehension for a set that contains the first ten e...
search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
Lambda Lambdas are basically anonymous functions that are used because we need some functions only once. Normally, w...
Lambda Lambdas are basically anonymous functions that are used because we need some functions only once. Normally, w...
Lambda >>> lambda x: x % 2http://learnyouahaskell.com/higher-order-functions#lambdas
Lambda >>> is_even = lambda x: x % 2http://learnyouahaskell.com/higher-order-functions#lambdas
Lambda >>> is_even = lambda x: x % 2 >>> is_even <function <lambda> at 0x2a3d050>http://learnyouahaskell.com/higher-...
search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)
Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)outras built-in f...
Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)outras built-in f...
Filterfilter(...) filter(function or None, sequence) -> list,tuple or string Return those items of sequence for which...
Filterfilter(...) filter(function or None, sequence) -> list,tuple or string Return those items of sequence for which...
Mapmap(...) map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying thefunction to th...
Reducereduce(...) reduce(function, sequence[, initial]) -> value Apply a function of two argumentscumulatively to the...
Sua High Order Functiondef f(x): return x + 1def g(function, x): return function(x) + function (x + 1)print g(f, 1)
Sua High Order Functiondef f(x): return x + 1 not baddef g(function, x): return function(x) +...
Porque aprender haskellme fez um programador python melhor?
Conseguientendermelhor ocódigo do Marcel!
Conseguientendermelhor o códigode outraspessoas!
Consegui entender melhor a minhalinguagem!
Consegui entender melhor o meuframework!
Resumindo
Domine sualinguagem
Evolua com asua linguagem
Domine outras linguagens (Tanto quanto)
Entenda quelinguagens são escolhas
Seja o principalcrítico das suas escolhas
Para saber mais:from functional import *
OBRIGADO! @gustavopinto gustavo@entropie.com.br
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
of 103

Porque aprender haskell me fez um programador python melhor?

Published on: Mar 4, 2016
Published in: Career      
Source: www.slideshare.net


Transcripts - Porque aprender haskell me fez um programador python melhor?

  • 1. Porque aprender haskellme fez um programador python melhor? @gustavopinto gustavo@entropie.com.br
  • 2. Porque aprender haskellme fez um programador python melhor? Baseado em fatos reais @gustavopinto gustavo@entropie.com.br
  • 3. Gustavo Pinto2004 - belém, grad, php, sh2006 - amazontic, java, xp2008 - curitiba, msc, python2009 - aprioriti, xp, scrum2011 - recife, phd, haskell2012 - entropie, lean, scala
  • 4. Belém
  • 5. Belém
  • 6. Belém
  • 7. Belém
  • 8. Belém
  • 9. Belém
  • 10. DISCLAIMER
  • 11. Não tem código
  • 12. Não tem código¬¬
  • 13. Mentira, tem mas épouquinho :-)
  • 14. 1912 ~ 1954
  • 15. 1912 ~ 1954 1936
  • 16. 1912 ~ 1954 1936
  • 17. ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THEENTSCHEIDUNGS PROBLEM
  • 18. ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THEENTSCHEIDUNGS PROBLEM
  • 19. ON COMPUTABLENUMBERS, WITHAN APPLICATION TO THE DECISION PROBLEM
  • 20. 1903 ~1995
  • 21. 1903 ~1995 1936
  • 22. 1903 ~1995 1936
  • 23. AN UNSOLVABLE PROBLEM OF ELEMENTARY NUMBER THEORY
  • 24. 1936
  • 25. 1936
  • 26. Church-Turing thesis
  • 27. Church-Turing thesis
  • 28. Church-Turing thesis Equivalentes
  • 29. Algumas features:● Pure functions● Functions as first-class objects● No side effects
  • 30. Algumas features:● Pure functions● Functions as first-class objects● No side effects Concurrency Friendly
  • 31. Great.. But, whatabout Python??
  • 32. Python functional
  • 33. Is python functional?
  • 34. Is python functional?
  • 35. I have never considered Python to be heavily influenced by functional languages, no matter what people say or think. I was much more familiar with imperative languages such as C and Algol 68 and although I had made functions first-class objects, I didnt view Python as a functional programming language. However, earlier on, it was clear that users wanted to do much more with lists and functions.http://python-history.blogspot.com.br/2009/04/origins-of-pythons-functional-features.html
  • 36. I have never considered Python to be heavily influenced by functional languages, no matter what people say or think. I was much more familiar with imperative languages such as C and Algol 68 and although I had made functions first-class objects, I didnt view Python as a functional programming language. However, earlier on, it was clear that users wanted to do much more with lists and functions.http://python-history.blogspot.com.br/2009/04/origins-of-pythons-functional-features.html
  • 37. I have never considered Python to be heavily influenced by functional languages, no matter what people say or think. I was much more familiar with imperative languages such as C and Algol 68 and although I had made functions first-class objects, I didnt view Python as a functional programming language. However, earlier on, it was clear that users wanted to do much more with lists and functions.http://python-history.blogspot.com.br/2009/04/origins-of-pythons-functional-features.html
  • 38. I have never considered Python to be heavily influenced by functional languages, no matter what people say or think. I was much more familiar with imperative languages such as C and Algol 68 and although I had made functions first-class objects, I didnt view Python as a functional programming language. However, earlier on, it was clear that users wanted to do much more with lists and functions.http://python-history.blogspot.com.br/2009/04/origins-of-pythons-functional-features.html
  • 39. I see list and functions
  • 40. if god exists: atepassar**2hack, hack
  • 41. search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
  • 42. search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
  • 43. List comprehension A basic comprehension for a set that contains the first ten even natural numbers is The part before the pipe is called the output function, x is the variable, N is the input set and x <= 10 is the predicate. That means that the set contains the doubles of all natural numbers that satisfy the predicate.http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 44. List comprehension A basic comprehension for a set that contains the first ten even natural numbers is The part before the pipe is called the output function, x is the variable, N is the input set and x <= 10 is the predicate. That means that the set contains the doubles of all natural numbers that satisfy the predicate.http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 45. List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in range (0, 100) if x > 10]http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 46. List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in range (0, 100) if x > 10] >>> [[row[i] for row in matrix] for i in range(4)]http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 47. List comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in range (0, 100) if x > 10] >>> [[row[i] for row in matrix] for i in range(4)] >>> dict([(i, chr(65+i)) for i in range(4)])http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 48. List Sou foda comprehension A basic comprehension for a set that contains the first ten even natural numbers is >>> [i for x in range (0, 100) if x > 10] >>> [[row[i] for row in matrix] for i in range(4)] >>> dict([(i, chr(65+i)) for i in range(4)])http://learnyouahaskell.com/starting-out#im-a-list-comprehension
  • 49. search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
  • 50. Lambda Lambdas are basically anonymous functions that are used because we need some functions only once. Normally, we make a lambda with the sole purpose of passing it to a higher-order function.http://learnyouahaskell.com/higher-order-functions#lambdas
  • 51. Lambda Lambdas are basically anonymous functions that are used because we need some functions only once. Normally, we make a lambda with the sole purpose of passing it to a higher-order function.http://learnyouahaskell.com/higher-order-functions#lambdas
  • 52. Lambda >>> lambda x: x % 2http://learnyouahaskell.com/higher-order-functions#lambdas
  • 53. Lambda >>> is_even = lambda x: x % 2http://learnyouahaskell.com/higher-order-functions#lambdas
  • 54. Lambda >>> is_even = lambda x: x % 2 >>> is_even <function <lambda> at 0x2a3d050>http://learnyouahaskell.com/higher-order-functions#lambdas
  • 55. search_list = lambda l,e : [ [ idx for idx, element in enumerate(l) if element == element_f ] for element_f in e]
  • 56. Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)
  • 57. Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)outras built-in functions: ● filter ● map ● reduce
  • 58. Built-in Functions>>> for mes in enumerate ([jan, fev, mar]):... print mes(0, jan)(1, fev)(2, mar)outras built-in functions: ● filter ● map Funções de ● reduce alta ordem
  • 59. Filterfilter(...) filter(function or None, sequence) -> list,tuple or string Return those items of sequence for whichfunction(item) is true. [....]>>> filter(lambda x: x % 2 == 0, range(10))
  • 60. Filterfilter(...) filter(function or None, sequence) -> list,tuple or string Return those items of sequence for whichfunction(item) is true. [....]>>> is_even = lambda x: x % 2 == 0>>> filter(is_even, range(10))
  • 61. Mapmap(...) map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying thefunction to the items of the argument sequence(s). [....]>>> map(lambda s: s.upper(), [a, b, c])
  • 62. Reducereduce(...) reduce(function, sequence[, initial]) -> value Apply a function of two argumentscumulatively to the items of a sequence, fromleft to right, so as to reduce the sequence to asingle value. [....]>>> reduce(lambda x,y: x * y, range(1, 4))>>> reduce(lambda x, y: x + y, [a, b, c, d])
  • 63. Sua High Order Functiondef f(x): return x + 1def g(function, x): return function(x) + function (x + 1)print g(f, 1)
  • 64. Sua High Order Functiondef f(x): return x + 1 not baddef g(function, x): return function(x) + function (x + 1)print g(f, 1)
  • 65. Porque aprender haskellme fez um programador python melhor?
  • 66. Conseguientendermelhor ocódigo do Marcel!
  • 67. Conseguientendermelhor o códigode outraspessoas!
  • 68. Consegui entender melhor a minhalinguagem!
  • 69. Consegui entender melhor o meuframework!
  • 70. Resumindo
  • 71. Domine sualinguagem
  • 72. Evolua com asua linguagem
  • 73. Domine outras linguagens (Tanto quanto)
  • 74. Entenda quelinguagens são escolhas
  • 75. Seja o principalcrítico das suas escolhas
  • 76. Para saber mais:from functional import *
  • 77. OBRIGADO! @gustavopinto gustavo@entropie.com.br

Related Documents