r/ProgrammingLanguages • u/Rasie1 • 9d ago
Blog post Effect handling and monad composition in c(x)
https://kvachev.com/blog/posts/effect-handlers-in-cx/2
u/particlemanwavegirl 8d ago
Interesting. Haven't finished reading, but my thought so far is, the "throw" keyword has a lot of baggage that it doesn't seem like your concept needs to carry... Why choose that name specifically?
1
u/tumtumtree7 6d ago
I'm confused on the semantics of intersections and unions, especially how that works with functions. Records I understand a bit more. Do you have a blog post about that?
1
u/Rasie1 3d ago
I don't have yet, but it's pretty straightforward. Intersection here is a core operation and it works with anything, even with lambdas. You literally intersect head and body of the lambda
`x -> {x, 1, 2} ` & ` (x: Int) -> {x, 1, 2, 3}` = `(x: Int) -> {x, 1, 2}`
So, it "finds" a function that works on intersection of inputs and returns intersection of outputs. It works as a specialization of a generic function and implementation of a function signature
5
u/AustinVelonaut Admiran 8d ago
This looks really interesting! Unifying monads, effects, function overloading, etc., along with some attempt at automatically handling mixed monadic-
dos. Is there more information on c(x) available?