Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtkp9993 committed May 9, 2018
1 parent 2125add commit 213a40a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,15 @@ Prelude> g 3

_Kısmi uygulama_, bir fonksiyonun bazı argümanlarını önceden doldurarak yeni bir fonksiyon oluşturmaktır.

```js
```haskell
// Orjinal fonksiyonumuz
const add3 = (a, b, c) => a + b + c
Prelude> let add3 a b c = a + b + c

//`2` ve `3` argümanlarını `add3` fonksiyonumuza vererek `fivePlus` fonksiyonumuzu oluşturuyoruz
const fivePlus = partial(add3, 2, 3) // (c) => 2 + 3 + c

fivePlus(4) // 9
```

Kısmi uygulama için `Function.prototype.bind` de kullanılabilir:
Prelude> let fivePlus = add3 2 3

```js
const add1More = add3.bind(null, 2, 3) // (c) => 2 + 3 + c
Prelude> fivePlus 4
9
```

Kısmi uygulama, kompleks fonksiyonlardan daha basit fonksiyonlar oluşturmaya yardım eder. [Curried](#currying) fonksiyonlar otomatik olarak kısmi uygulanmış fonksiyonlardır.
Expand Down

0 comments on commit 213a40a

Please sign in to comment.