{"defs":[{"ctors":[{"fields":[{"k":"var","name":"e"}],"name":"Left"},{"fields":[{"k":"var","name":"a"}],"name":"Right"}],"doc":"Disjoint sum: Left<e> for the failure branch, Right<a> for the success branch. Right is the conventional 'success' side.","kind":"type","name":"Either","vars":["e","a"]},{"body":{"arms":[{"body":{"name":"v","t":"var"},"pat":{"ctor":"Right","fields":[{"name":"v","p":"var"}],"p":"ctor"}},{"body":{"name":"default","t":"var"},"pat":{"ctor":"Left","fields":[{"p":"wild"}],"p":"ctor"}}],"scrutinee":{"name":"x","t":"var"},"t":"match"},"doc":"Project the Right<a> payload, or use the default for Left<_>.","kind":"fn","name":"from_right","params":["default","x"],"type":{"body":{"effects":[],"k":"fn","params":[{"k":"var","name":"a"},{"args":[{"k":"var","name":"e"},{"k":"var","name":"a"}],"k":"con","name":"Either"}],"ret":{"k":"var","name":"a"}},"k":"forall","vars":["e","a"]}},{"body":{"arms":[{"body":{"lit":{"kind":"bool","value":true},"t":"lit"},"pat":{"ctor":"Left","fields":[{"p":"wild"}],"p":"ctor"}},{"body":{"lit":{"kind":"bool","value":false},"t":"lit"},"pat":{"ctor":"Right","fields":[{"p":"wild"}],"p":"ctor"}}],"scrutinee":{"name":"x","t":"var"},"t":"match"},"doc":"Returns true iff x is Left<_>.","kind":"fn","name":"is_left","params":["x"],"type":{"body":{"effects":[],"k":"fn","params":[{"args":[{"k":"var","name":"e"},{"k":"var","name":"a"}],"k":"con","name":"Either"}],"ret":{"k":"con","name":"Bool"}},"k":"forall","vars":["e","a"]}},{"body":{"arms":[{"body":{"lit":{"kind":"bool","value":false},"t":"lit"},"pat":{"ctor":"Left","fields":[{"p":"wild"}],"p":"ctor"}},{"body":{"lit":{"kind":"bool","value":true},"t":"lit"},"pat":{"ctor":"Right","fields":[{"p":"wild"}],"p":"ctor"}}],"scrutinee":{"name":"x","t":"var"},"t":"match"},"doc":"Returns true iff x is Right<_>.","kind":"fn","name":"is_right","params":["x"],"type":{"body":{"effects":[],"k":"fn","params":[{"args":[{"k":"var","name":"e"},{"k":"var","name":"a"}],"k":"con","name":"Either"}],"ret":{"k":"con","name":"Bool"}},"k":"forall","vars":["e","a"]}},{"body":{"arms":[{"body":{"args":[{"args":[{"name":"v","t":"var"}],"fn":{"name":"f","t":"var"},"t":"app"}],"ctor":"Right","t":"ctor","type":"Either"},"pat":{"ctor":"Right","fields":[{"name":"v","p":"var"}],"p":"ctor"}},{"body":{"args":[{"name":"l","t":"var"}],"ctor":"Left","t":"ctor","type":"Either"},"pat":{"ctor":"Left","fields":[{"name":"l","p":"var"}],"p":"ctor"}}],"scrutinee":{"name":"x","t":"var"},"t":"match"},"doc":"Apply f to the Right<a> payload; pass Left<e> through untouched.","kind":"fn","name":"map_right","params":["f","x"],"type":{"body":{"effects":[],"k":"fn","params":[{"effects":[],"k":"fn","params":[{"k":"var","name":"a"}],"ret":{"k":"var","name":"b"}},{"args":[{"k":"var","name":"e"},{"k":"var","name":"a"}],"k":"con","name":"Either"}],"ret":{"args":[{"k":"var","name":"e"},{"k":"var","name":"b"}],"k":"con","name":"Either"}},"k":"forall","vars":["e","a","b"]}},{"body":{"arms":[{"body":{"args":[{"name":"l","t":"var"}],"fn":{"name":"on_left","t":"var"},"t":"app"},"pat":{"ctor":"Left","fields":[{"name":"l","p":"var"}],"p":"ctor"}},{"body":{"args":[{"name":"r","t":"var"}],"fn":{"name":"on_right","t":"var"},"t":"app"},"pat":{"ctor":"Right","fields":[{"name":"r","p":"var"}],"p":"ctor"}}],"scrutinee":{"name":"x","t":"var"},"t":"match"},"doc":"Eliminator: apply on_left to a Left payload, on_right to a Right payload, fold both branches into the same result type c.","kind":"fn","name":"either","params":["on_left","on_right","x"],"type":{"body":{"effects":[],"k":"fn","params":[{"effects":[],"k":"fn","params":[{"k":"var","name":"e"}],"ret":{"k":"var","name":"c"}},{"effects":[],"k":"fn","params":[{"k":"var","name":"a"}],"ret":{"k":"var","name":"c"}},{"args":[{"k":"var","name":"e"},{"k":"var","name":"a"}],"k":"con","name":"Either"}],"ret":{"k":"var","name":"c"}},"k":"forall","vars":["e","a","c"]}}],"imports":[],"name":"std_either","schema":"ailang/v0"}
