つまり、フロントエンドではバリデーションにおける「有効」「無効」の状態以外に「入力中」のような状態が必要になる。では、これを現実的にどう設計し実装するか。これが、自分がDEVに投稿した"Designing Opaque Type for form fields in Elm"シリーズのPart 1でカバーしている内容である。
ZLayer is a simple, declarative recipe for building a service in terms of its dependencies.
It's an edge in your application's dependency graph, expressed as a value, with type-safe, composable operators that let you build big graphs out of parts. 1/4
object Main extends App {
val program: Runnable = ???
for {
_ <- program.output("hello!")
_ <- program.output("what's your name?")
name <- program.input
_ <- program.output(s"$name, nice to meet you.")
} yield name
}