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

Commit 4f26f16

Browse files
authored
Monad_API翻訳 (#36)
* 翻訳開始 * 翻訳完了
1 parent dbc7a26 commit 4f26f16

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

Manual/Monads/API.lean

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,36 @@ set_option pp.rawOnError true
1919

2020
set_option linter.unusedVariables false
2121

22+
/-
2223
#doc (Manual) "API Reference" =>
24+
-/
25+
#doc (Manual) "API リファレンス(API Reference)" =>
2326

27+
:::comment
2428
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:
2529
* `mapM` maps a monadic function.
2630
* `forM` maps a monadic function, throwing away the result.
2731
* `filterM` filters using a monadic predicate, returning the values that satisfy it.
2832

2933

30-
::::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
3146
{name}`Array.filterM` can be used to write a filter that depends on a side effect.
3247

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

90+
:::comment
7191
# Discarding Results
92+
:::
93+
94+
# 結果の破棄(Discarding Results)
7295

96+
97+
:::comment
7398
The {name}`discard` function is especially useful when using an action that returns a value only for its side effects.
7499

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

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

79113
{docstring guard}
80114

81115
{docstring optional}
82116

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

85124
{docstring andM}
86125

87126
{docstring orM}
88127

89128
{docstring notM}
90129

130+
:::comment
91131
# Kleisli Composition
132+
:::
133+
134+
# Kleisli 合成(Kleisli Composition)
92135

136+
137+
:::comment
93138
{deftech}_Kleisli composition_ is the composition of monadic functions, analogous to {name}`Function.comp` for ordinary functions.
94139

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

97146
{docstring Bind.kleisliLeft}
98147

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

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

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

106165
{docstring Bind.bindLeft}

0 commit comments

Comments
 (0)