{"defs":[{"body":{"args":[{"name":"x","t":"var"},{"lit":{"kind":"int","value":1},"t":"lit"}],"fn":{"name":"+","t":"var"},"t":"app"},"doc":"Add 1 to an Int. Used as the function arg to map_right and either.","kind":"fn","name":"inc","params":["x"],"type":{"effects":[],"k":"fn","params":[{"k":"con","name":"Int"}],"ret":{"k":"con","name":"Int"}}},{"body":{"lhs":{"args":[{"args":[{"lit":{"kind":"int","value":0},"t":"lit"},{"args":[{"lit":{"kind":"int","value":42},"t":"lit"}],"ctor":"Right","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.from_right","t":"var"},"t":"app"}],"op":"io/print_int","t":"do"},"rhs":{"lhs":{"args":[{"args":[{"lit":{"kind":"int","value":99},"t":"lit"},{"args":[{"lit":{"kind":"int","value":7},"t":"lit"}],"ctor":"Left","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.from_right","t":"var"},"t":"app"}],"op":"io/print_int","t":"do"},"rhs":{"lhs":{"args":[{"args":[{"args":[{"lit":{"kind":"int","value":7},"t":"lit"}],"ctor":"Left","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.is_left","t":"var"},"t":"app"}],"op":"io/print_bool","t":"do"},"rhs":{"lhs":{"args":[{"args":[{"args":[{"lit":{"kind":"int","value":42},"t":"lit"}],"ctor":"Right","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.is_right","t":"var"},"t":"app"}],"op":"io/print_bool","t":"do"},"rhs":{"lhs":{"args":[{"args":[{"lit":{"kind":"int","value":0},"t":"lit"},{"args":[{"name":"inc","t":"var"},{"args":[{"lit":{"kind":"int","value":41},"t":"lit"}],"ctor":"Right","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.map_right","t":"var"},"t":"app"}],"fn":{"name":"std_either.from_right","t":"var"},"t":"app"}],"op":"io/print_int","t":"do"},"rhs":{"lhs":{"args":[{"args":[{"name":"inc","t":"var"},{"name":"inc","t":"var"},{"args":[{"lit":{"kind":"int","value":5},"t":"lit"}],"ctor":"Left","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.either","t":"var"},"t":"app"}],"op":"io/print_int","t":"do"},"rhs":{"args":[{"args":[{"name":"inc","t":"var"},{"name":"inc","t":"var"},{"args":[{"lit":{"kind":"int","value":100},"t":"lit"}],"ctor":"Right","t":"ctor","type":"std_either.Either"}],"fn":{"name":"std_either.either","t":"var"},"t":"app"}],"op":"io/print_int","t":"do"},"t":"seq"},"t":"seq"},"t":"seq"},"t":"seq"},"t":"seq"},"t":"seq"},"doc":"Drive each std_either combinator. Expected outputs (per line): 42, 99, true, true, 42, 6, 101.","kind":"fn","name":"main","params":[],"type":{"effects":["IO"],"k":"fn","params":[],"ret":{"k":"con","name":"Unit"}}}],"imports":[{"module":"std_either"}],"name":"std_either_demo","schema":"ailang/v0"}
