You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Much of my love for pure functional programming comes from React, where context is everything for its usability and composability. As such, I very much want to add algebraic effects to the language. For example, consider division (syntax speculative):
effect DivideByZero *
div: forall a: Fraction e. a -> a -> (a + (effect DivideByZero e))
If we wanted to terminate the program upon a divide-by-zero:
main = doAllTheThings | handle {
DivideByZero = undefined
}
If we wanted to wrap in Maybe:
mdiv = handle {
DivideByZero = None
} . Some . div
Much of my love for pure functional programming comes from React, where context is everything for its usability and composability. As such, I very much want to add algebraic effects to the language. For example, consider division (syntax speculative):
If we wanted to terminate the program upon a divide-by-zero:
If we wanted to wrap in
Maybe
:Context lookup
where the value
config
has type({ timeout: Double }) & (effect config)
Semantics
The text was updated successfully, but these errors were encountered: