このスニペットy.run
では型チェックを行いません。
object Test {
type StateStringTask[A] = StateStringT[Task, A]
type StateStringT[M[_], A] = StateT[M, String, A]
val x: Process[Task, Unit] = ???
val y: Process[StateStringTask, Unit] = ???
x.run // This typechecks
y.run // This fails
}
コンパイラは次のエラーを表示します。
could not find implicit value for parameter C: scalaz.Catchable[[x]Test.StateStringTask[x]]
Catchable
のインスタンスを作成する必要がありますStateStringTask
か? それ、どうやったら出来るの?または、実行時にステートフル効果を処理する簡単な方法はありProcess
ますか?