Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit c6cf53e

Browse files
committed
翻訳完了
1 parent 62cb91b commit c6cf53e

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

Manual/Monads/API.lean

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,31 @@ set_option linter.unusedVariables false
2424
-/
2525
#doc (Manual) "API リファレンス(API Reference)" =>
2626

27+
:::comment
2728
In addition to the general functions described here, there are some functions that are conventionally defined as part of the API of in the namespace of each collection type:
2829
* `mapM` maps a monadic function.
2930
* `forM` maps a monadic function, throwing away the result.
3031
* `filterM` filters using a monadic predicate, returning the values that satisfy it.
3132

3233

33-
::::example "Monadic Collection Operations"
34+
:::
35+
36+
ここで説明する一般的な関数に加えて、各コレクション型の名前空間の API の一部として慣習的に定義されている関数がいくつかあります:
37+
* `mapM` はモナド関数をマップします。
38+
* `forM` はモナド関数をマップし、結果を捨てます。
39+
* `filterM` はモナド述語を使ってフィルタリングを行い、それを満たす値を返します。
40+
41+
:::comment
42+
::example "Monadic Collection Operations"
43+
:::
44+
::::example "モナドのコレクションに対する操作"
45+
:::comment
3446
{name}`Array.filterM` can be used to write a filter that depends on a side effect.
3547

48+
:::
49+
50+
{name}`Array.filterM` を使用すると、副作用に依存したフィルタを書くことができます。
51+
3652
:::ioExample
3753
```ioLean
3854
def values := #[1, 2, 3, 5, 8]
@@ -71,39 +87,79 @@ These values were kept:
7187
:::
7288
::::
7389

90+
:::comment
7491
# Discarding Results
92+
:::
7593

94+
# 結果の破棄(Discarding Results)
95+
96+
97+
:::comment
7698
The {name}`discard` function is especially useful when using an action that returns a value only for its side effects.
7799

100+
:::
101+
102+
{name}`discard` 関数は副作用のためだけに値を返すアクションを使うときに便利です。
103+
78104
{docstring discard}
79105

106+
:::comment
80107
# Control Flow
108+
:::
109+
110+
# フローの制御(Control Flow)
111+
81112

82113
{docstring guard}
83114

84115
{docstring optional}
85116

117+
:::comment
86118
# Lifting Boolean Operations
119+
:::
120+
121+
# 真偽値演算子の持ち上げ(Lifting Boolean Operations)
122+
87123

88124
{docstring andM}
89125

90126
{docstring orM}
91127

92128
{docstring notM}
93129

130+
:::comment
94131
# Kleisli Composition
132+
:::
95133

134+
# Kleisli 合成(Kleisli Composition)
135+
136+
137+
:::comment
96138
{deftech}_Kleisli composition_ is the composition of monadic functions, analogous to {name}`Function.comp` for ordinary functions.
97139

140+
:::
141+
142+
{deftech}_Kleisli 合成_ (Kleisli composition)はモナド関数の合成で、普通の関数の {name}`Function.comp` に似ています。
143+
98144
{docstring Bind.kleisliRight}
99145

100146
{docstring Bind.kleisliLeft}
101147

148+
:::comment
102149
# Re-Ordered Operations
150+
:::
151+
152+
# 並べ替え操作(Re-Ordered Operations)
153+
103154

155+
:::comment
104156
Sometimes, it can be convenient to partially apply a function to its second argument.
105157
These functions reverse the order of arguments, making it this easier.
106158

159+
:::
160+
161+
関数の第2引数に関数を部分適用すると便利な場合があります。これらの関数は引数の順序を逆にすることでこれを簡単に行うことができます。
162+
107163
{docstring Functor.mapRev}
108164

109165
{docstring Bind.bindLeft}

0 commit comments

Comments
 (0)