Files
freeCodeCamp/guide/chinese/haskell/monad/index.md
2018-10-16 21:32:40 +05:30

25 lines
367 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Monad
localeTitle: 单子
---
# Monad Laws
数据类型必须满足3个法则才能被视为monad
# 也许莫纳德
```haskell
justHead :: Maybe Char
justHead = do
(x:xs) <- Just ""
return x
```
# 列出Monad
回归与纯粹的应用相同
实例Monad \[\]在哪里
return x = \[x\]
xs >> = f = concatmap f xs
失败\_ = \[\]