You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2025. It is now read-only.
3. A `MonadLift` instance that translates actions of type `m α` into actions of type `T m α`, for arbitrary monads `m`. This enables actions from the underlying monad to be used in the transformed monad.
26
20
-->
21
+
1. モナドを引数に取る定義もしくはデータ型 `T` 。これは `(Type u → Type v) → Type u → Type v` のような型を持ちますが、モナドの前に別で引数を受け取ることもできます。
Furthermore, the `Monad` instance for the transformer should obey the contract for `Monad`, at least if the underlying `Monad` instance does.
31
27
In addition, `monadLift (pure x)` should be equivalent to `pure x` in the transformed monad, and `monadLift` should distribute over `bind` so that `monadLift (x >>= f)` is the same as `monadLift x >>= fun y => monadLift (f y)`.
32
28
-->
33
29
34
-
さらに、変換子の`Monad`インスタンスはベースとなった`Monad`インスタンスがモナドの約定に従うのであれば`Monad` の約定に従わなければなりません。加えて、`monadLift (pure x)` は変換後のモナドでは `pure x`と等価、`monadLift` は `monadLift (x >>= f)` が `monadLift x >>= fun y => monadLift (f y)` と同じになるように `bind` に対して分配されるべきです。
30
+
さらに、ベースとなった`Monad`インスタンスがモナドの約定に従うのであれば、変換子の`Monad`インスタンスは`Monad` の約定に従わなければなりません。加えて、`monadLift (pure x)` は変換後のモナドでは `pure x`と等価になるべき、また `monadLift` は `monadLift (x >>= f)` が `monadLift x >>= fun y => monadLift (f y)` と同じになるように `bind` に対して分配されるべきです。
35
31
36
32
<!--
37
33
Many monad transformers additionally define type classes in the style of `MonadReader` that describe the actual effects available in the monad.
@@ -321,7 +317,7 @@ This means that it is reasonable to lift `Except ε` actions into `ExceptT ε m`
321
317
Lifting `Except` actions into `ExceptT` actions is done by wrapping them in `m`'s `pure`, because an action that only has exception effects cannot have any effects from the monad `m`:
0 commit comments