Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

面向 JavaScript 开发人员的 Monads #8102

Merged
merged 3 commits into from Mar 9, 2021
Merged

面向 JavaScript 开发人员的 Monads #8102

merged 3 commits into from Mar 9, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 27, 2021

@lsvih 译文翻译完成,resolve #8058

Copy link
Contributor

@PassionPenguin PassionPenguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻译得挺棒哒~ @lsvih @zenblo


![](https://cdn-images-1.medium.com/max/5760/1*gA2dHvfpZEylFTBuiLiKxw.jpeg)

Like every other programmer, I wanted to know, what **Monads** are. But every time you search for Monads on the internet, you get flooded with category theory papers. And other resources don’t seem to make much sense either.
和其他程序员一样,我也想知道 **Monads** 是什么。但是每次在网上搜索 Monads,都只会找到大量的 Monads 理论范畴文章,而其它资源似乎也没有参考意义。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
和其他程序员一样,我也想知道 **Monads** 是什么。但是每次在网上搜索 Monads,都只会找到大量的 Monads 理论范畴文章,而其它资源似乎也没有参考意义
和别的程序员一样,我也很想知道 **Monads** 到底是什么。但每当我在网上搜索 Monads 的时候,都只会找到大量的 Monads 理论范畴文章,而其它的资源似乎也并没有什么参考意义


To learn what Monads are, I did it the hard way. I started learning Haskell. Only to realize, after few months, that people make too much of a fuss of Monads. If you’re a JavaScript developer, you’re most definitely using them daily. You’re just not aware of it.
为了学会什么是 Monads,我花费了大量时间精力。我开始学习 Haskell,几个月后才发现,人们对 Monads 太小题大做了。如果你是一名 JavaScript 开发人员,那么你肯定每天都在使用它们,你只是没有意识到而已。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
为了学会什么是 Monads,我花费了大量时间精力。我开始学习 Haskell,几个月后才发现,人们对 Monads 太小题大做了。如果你是一名 JavaScript 开发人员,那么你肯定每天都在使用它们,你只是没有意识到而已
为了搞清楚什么是 Monads,我花费了大量的时间精力。我开始去学习 Haskell,但在学了几个月后,我才突然意识到,大家都在 Monads 上面太小题大做了。如果你是一名 JavaScript 开发人员,那么你肯定每天都在使用它,只是你并没有意识到而已


---

We won’t be getting into much detail about the category theory or Haskell, but there’s one thing you need to know. When you search for Monads on the internet, you cannot miss this definition:
本文不会讲太多关于 Monads 理论范畴或 Haskell 的细节,但有一件事需要知道。当你在互联网上搜索 Monads 时,你不能错过这个定义:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
本文不会讲太多关于 Monads 理论范畴或 Haskell 的细节,但有一件事需要知道。当你在互联网上搜索 Monads 时,你不能错过这个定义
本文并不会提及太多有关 Monads 的理论范畴或在 Haskell 中的细节,但有一件事我们始终需要知道 —— 当我们在互联网上搜索 Monads 时,我们不能错过这个定义


## JavaScript Promises Are Similar To Monads
## Promises 类似 Monads
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Promises 类似 Monads
## JavaScript 中的 Promises 类似于 Monads

@ghost
Copy link
Author

ghost commented Feb 28, 2021

@PassionPenguin 感谢校对 @lsvih 完成 1 次校对

@zaviertang
Copy link
Contributor

校对认领

@lsvih
Copy link
Member

lsvih commented Mar 4, 2021

@zaviertang 欢迎校对

@lsvih lsvih removed the 校对认领 label Mar 4, 2021
Copy link
Contributor

@zaviertang zaviertang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

译者翻译的很好,逻辑清晰,检查了格式也没有任何问题。校对完成 @lsvih


---

We won’t be getting into much detail about the category theory or Haskell, but there’s one thing you need to know. When you search for Monads on the internet, you cannot miss this definition:
本文并不会提及太多有关 Monads 的理论范畴或在 Haskell 中的细节,但有一件事我们始终需要知道 —— 当我们在互联网上搜索 Monads 时,我们不能错过这个定义:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
本文并不会提及太多有关 Monads 的理论范畴或在 Haskell 中的细节,但有一件事我们始终需要知道 —— 当我们在互联网上搜索 Monads 时,我们不能错过这个定义
本文并不会提及太多有关 Monads 的理论范畴或 Haskell 的细节,但有一件事我们始终需要知道 —— 当我们在互联网上搜索 Monads 时,不能错过这个定义


```js
// divideByTwo :: (a -> m b)
const divideByTwo = val => Promise.resolve(val / 2);
```

☝️ This is our `(a -> m b)`.
☝️ 这是我们的 `(a -> m b)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
☝️ 这是我们的 `(a -> m b)`
☝️ 这就是我们的 `(a -> m b)`

@ghost
Copy link
Author

ghost commented Mar 9, 2021

@lsvih 完成 2 次校对

@lsvih lsvih merged commit 73108d6 into xitu:master Mar 9, 2021
@lsvih
Copy link
Member

lsvih commented Mar 9, 2021

@zenblo 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@ghost ghost deleted the monads-for-javascript-developers branch March 9, 2021 06:19
@ghost
Copy link
Author

ghost commented Mar 9, 2021

@lsvih
Copy link
Member

lsvih commented Mar 9, 2021

收到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

面向 JavaScript 开发人员的 Monads
3 participants