Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtkp9993 committed May 4, 2018
1 parent ea600c6 commit dcd68e3
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,26 +232,18 @@ undefined

## Constant

A variable that cannot be reassigned once defined.
Bir kere tanımlandıktan sonra yeniden atanamayan değişkenlerdir.

```js
const five = 5
const john = Object.freeze({name: 'John', age: 30})
```

Constants are [referentially transparent](#referential-transparency). That is, they can be replaced with the values that they represent without affecting the result.

With the above two constants the following expression will always return `true`.

```js
john.age + five === ({name: 'John', age: 30}).age + (5)
```

## Functor

An object that implements a `map` function which, while running over each value in the object to produce a new object, adheres to two rules:
`map` fonksiyonunu implemente eden bir nesnedir ve aşağıdaki iki özelliği sağlar:

__Preserves identity__
__Identity__
```
object.map(x => x) ≍ object
```
Expand All @@ -262,24 +254,6 @@ __Composable__
object.map(compose(f, g)) ≍ object.map(g).map(f)
```

(`f`, `g` are arbitrary functions)

A common functor in JavaScript is `Array` since it abides to the two functor rules:

```js
;[1, 2, 3].map(x => x) // = [1, 2, 3]
```

and

```js
const f = x => x + 1
const g = x => x * 2

;[1, 2, 3].map(x => f(g(x))) // = [3, 5, 7]
;[1, 2, 3].map(g).map(f) // = [3, 5, 7]
```

## Pointed Functor
An object with an `of` function that puts _any_ single value into it.

Expand Down

0 comments on commit dcd68e3

Please sign in to comment.