Skip to content

Commit

Permalink
update ch12
Browse files Browse the repository at this point in the history
  • Loading branch information
cigui committed Jun 9, 2021
1 parent 5cd69fb commit 8e41558
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ch12.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Left extends Either {

## 作用组合

就我们的容器而言,不同的顺序会带来不同的结果,如果我有一个 `[Maybe a]`,它是一个包含可能的值的集合 (a collection of possible values);而如果我有一个 `Maybe [a]`,那是一个可能的包含值的集合 (a possible collection of values)。前者表示我们会宽容的保留那些"好"的值,而后者则意味着这是一个 "all or nothing" 的情况。类似地,`Either Error (Task Error a)` 可以表示一个客户端的验证,而 `Task Error (Either Error a)` 则会是一个服务端的验证。类型可以互换,为我们带来不同的作用。
就我们的容器而言,不同的顺序会带来不同的结果,如果我有一个 `[Maybe a]`,它是一个包含可能的值的集合 (a collection of possible values);而如果我有一个 `Maybe [a]`,那是一个可能的包含值的集合 (a possible collection of values)。前者表示我们会宽容地保留那些"好"的值,而后者则意味着这是一个 "all or nothing" 的情况。类似地,`Either Error (Task Error a)` 可以表示一个客户端的验证,而 `Task Error (Either Error a)` 则会是一个服务端的验证。类型可以互换,为我们带来不同的作用。

```js
// fromPredicate :: (a -> Bool) -> a -> Either e a
Expand Down

0 comments on commit 8e41558

Please sign in to comment.