Skip to content

Commit 86ab9b8

Browse files
committed
continuing translation
1 parent e6b5ccd commit 86ab9b8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

manuscript/ch2.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,39 @@ A pergunta "O que é uma Função?" superficialmente aparenta ter uma resposta
1515

1616
Embora a definição seja razoável, está em falta uma essência muito importante que é o núcleo de uma *funcão* visto que se aplica a FP. Portanto vamos cavar abaixo da superfície para compreender mais completamente as funções .
1717

18-
### Brief Math Review
18+
### Breve Revisão de Matemática
1919

20-
I know I've promised we'd stay away from math as much as possible, but bear with me for a moment as we quickly observe some fundamental things about functions and graphs from algebra before we proceed.
20+
Eu sei que prometi que nos afastaríamos o maximo possível da matemática, mas aguentem comigo por um momento, enquanto observamos de forma rápida.
2121

22-
Do you remember learning anything about `f(x)` back in school? What about the equation `y = f(x)`?
22+
Voltando a escola, você se lembra de aprender algo sobre `f(x)` ? e sobre a equação `y = f(x)`?
2323

24-
Let's say an equation is defined like this: <code>f(x) = 2x<sup>2</sup> + 3</code>. What does that mean? What does it mean to graph that equation? Here's the graph:
24+
Digamos que uma equação é definida assim: <code>f(x) = 2x<sup>2</sup> + 3</code>. O que isso significa? O que siginifica representar graficamente essa equação? Aqui está o gráfico:
2525

2626
<p align="center">
2727
<img src="images/fig1.png" width="40%">
2828
</p>
2929

30-
What you can notice is that for any value of `x`, say `2`, if you plug it into the equation, you get `11`. What is `11`, though? It's the *return value* of the `f(x)` function, which earlier we said represents a `y` value.
30+
O que se pode notar para qualquer valor de `x`, digamos `2`, se inserir na equação, obtém´se `11`. Mas o que é o `11`? É o *valor de retorno* da função `f(x)`, que anteriormente representava o valor de `y`.
3131

32-
In other words, we can choose to interpret the input and output values as a point at `(2,11)` on that curve in the graph. And for every value of `x` we plug in, we get another `y` value that pairs with it as a coordinate for a point. Another is `(0,3)`, and another is `(-1,5)`. Put all those points together, and you have the graph of that parabolic curve as shown here.
32+
Em outras palavras, podemos escolher interpretar o valores de entrada(input) e saída(output) como em um ponto `(2,11)` nessa curva do gráfico. E para cada valor de `x` inserirmos, obteremos outro valor de `y` que se equipara a ele como uma coordenada em um ponto. Outro é `(0,3)`, e o outro é `(-1,5)`. Junto todos esses pontos, e você terá o gráfico desta curva parabólica como mostrado aqui.
3333

34-
So what's any of this got to do with FP?
34+
Então o que isto tem a ver com FP?
3535

36-
In math, a function always takes input(s), and always gives an output. A term you'll often hear around FP is "morphism"; this is a fancy way of describing a set of values that maps to another set of values, like the inputs of a function related to the outputs of that function.
36+
Na Matemática, uma função sempre recebe entradas(input), e sempre devolve uma saída(output). Um termo que se ouve com frequência em torno de FP é "morfismo"; esta é uma forma elegante de descrever um conjunto de valores que mapeia outro conjunto de valores, como as entradas de uma função relacionadas às saídas desta função.
3737

38-
In algebraic math, those inputs and outputs are often interpreted as components of coordinates to be graphed. In our programs, however, we can define functions with all sorts of input(s) and output(s), even though they'll rarely be interpreted as a visually plotted curve on a graph.
38+
Na matemática algébrica, essas entradas são muitas vezes interpretadas como componentes de coordenadas a serem marcadas. Nos nossos programas, contudo, podemos definir funções com todo tipo de entrada(input) e saída(output), mesmo que raramente sejam interpretadas como uma curva visualmente traçada num gráfico.
3939

40-
### Function vs Procedure
40+
### Funcões vs Procedimentos
4141

42-
So why all the talk of math and graphs? Because essentially Functional Programming is about embracing using functions as *functions* in this mathematical sense.
42+
Então porquê toda essa conversa sobre gráficos e matemática? Porque essencialmente a programação funcional consiste em abordar a utilização de funções como *funções* neste sentido matemático.
4343

44-
You may be more accustomed to thinking of functions as procedures. What's the difference? A procedure is an arbitrary collection of functionality. It may have inputs, it may not. It may have an output (`return` value), it may not.
44+
Pode estar acostumado a pensar em funções como procedimentos(procedure). Qual é a diferença? Procedimentos são uma coleção arbitrária de funcionalidades. Pode ter entradas, pode não ter. Pode ter saídas (valor do `return`), pode não ter.
4545

46-
A function takes input(s) and definitely always has a `return` value.
46+
Uma função recebe entradas e definitivamente sempre tem valor de `return`.
4747

48-
If you plan to do Functional Programming, **you should be using functions as much as possible**, and trying to avoid procedures wherever possible. All your `function`s should take input(s) and return output(s).
48+
Se você planeja utilizar programação funcional, **deve usar as funções tanto quanto possível**, e tentar evitar procedimentos sempre que possível. Todas as suas `funções` devem ter entrada e retornar saída.
4949

50-
Why? The answer to that will have many levels of meaning that we'll uncover throughout this book.
50+
Por Que? A resposta a isso tera muitos níveis de significado que iremos descobrir ao longo deste livro .
5151

5252
## Function Input
5353

0 commit comments

Comments
 (0)