4 ms·
Algebraic effect systems can also do this. See Koka, Eff, Multicore OCaml, Frank, Purescript-run, freer-effects, freer-simple etc. These generally allow you to
by bjz_ 8y ago
Algebraic effect systems can also do this. See Koka, Eff, Multicore OCaml, Frank, Purescript-run, freer-effects, freer-simple etc. These generally allow you to handle effects in different ways. Not sure if F#'s type system is powerful enough to build this as a library though.
- default-kramer 8y agoI took a look at Koka and it doesn't look like what I want because I have to correctly specify the effects whenever I write a function signature. What I am looking for is a type system that would track these "implicit dependencies" but not force me to pollute all my type signatures with them. In other words, if the compiler knows the type is function square3( x : int ) : div int My code should be allowed say function square3( x : int ) : int Basically, the problem is that in most typed languages, if you add a logger dependency to a function, then you have to rewrite the signatures of all the functions that depend on that function. That sucks.
- noblethrasher 8y agoLogging with computation expressions: https://fsharpforfunandprofit.com/posts/computation-expressions-intro/ https://fsharpforfunandprofit.com/posts/computation-expressi...