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
The idea is that Selective models selective function application of type S -> T. Given a type refinement S -> P, Selective#when() applies a function P -> U, producing a new Selective of type S -> T | U. It looks like this in action:
declareconststring: Selective<string>;declareconstisFoo: Refinement<string,"foo">;declareconstisBar: Refinement<string,"bar">;constnumber=string// If string is "foo", produce 42.when(isFoo,(foo)=>42)// If string is "bar", produce 56.when(isBar,(bar)=>56)// If string is neither "bar" nor "foo", produce 23.getOr(23);
The text was updated successfully, but these errors were encountered:
#394 (comment)
The text was updated successfully, but these errors were encountered: