raulraja
01/06/2018, 11:14 AMStream<F<_>, A>
where F is a higher kinded type constructor denoting the Effect capturing monad frequently just IO
.
Coroutines are a low level framework in Kotlin that allows you to do also reactive style programming.
Arrow uses coroutines to model for comprehensions. Arrow also includes typeclasses and datatypes to express concurrency and async. IO
itself is an async capable monad that captures exceptions and can be safely composed until you are ready to unsafe run it at the edge.
Note FRP is usually mislabeled in this community since it's associated to RxJava and other frameworks. But that is not what FRP is. This is https://github.com/conal/talk-2015-essence-and-origins-of-frp
Arrow on the other hand offers the FP way of doing that kind of stuff.
This for example is a reactive program in the sense that each instructions may be executed async while not concurrent because there is data dependencies and it is expressed in imperative monadic style:
IO.monad().binding {
val student = getStudentFromDatabase("Bob Roxx").bind()
val university = getUniversityFromDatabase(student.universityId).bind()
val dean = getDeanFromDatabase(university.deanId).bind()
yields(dean)
}