-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Expressiveness can be increased using infix operators.
p1 <*> p2 // == p1.then(p2)
p1 <|> p2 // == p1.or(p2)
p1 >>= p2 // == p1.flatmap(p2)
p1 || p2 // == p1.chain(p2)This can be achieved using Sweet.JS meta language.
operator <*> left 1 = (left, right) => #`${left}.then(${right})`;
operator <|> left 1 = (left, right) => #`${left}.or(${right})`;
operator >>= left 1 = (left, right) => #`${left}.flatmap(${right})`;
operator || left 1 = (left, right) => #`${left}.chain(${right})`;Reactions are currently unavailable