diff options
author | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-17 22:53:01 -0800 |
---|---|---|
committer | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-17 22:53:01 -0800 |
commit | d07fc9735f40e545edda456e15dbab783c500f6a (patch) | |
tree | 4d9fab82a7085b73a4b00d23389935503fdfc90d /src/algebra/product.spad.pamphlet | |
parent | 5437d438937eb25eb320fef6e4fd6ebc91ca6dc9 (diff) | |
download | open-axiom-d07fc9735f40e545edda456e15dbab783c500f6a.tar.gz |
subtractIfCan$CancellationAbelianMonoid: return the more principled Maybe %
Diffstat (limited to 'src/algebra/product.spad.pamphlet')
-rw-r--r-- | src/algebra/product.spad.pamphlet | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/algebra/product.spad.pamphlet b/src/algebra/product.spad.pamphlet index e10d11a8..94635e44 100644 --- a/src/algebra/product.spad.pamphlet +++ b/src/algebra/product.spad.pamphlet @@ -80,10 +80,10 @@ Product (A:SetCategory,B:SetCategory) : C == T if A has CancellationAbelianMonoid and B has CancellationAbelianMonoid then - subtractIfCan(x, y) : Union(%,"failed") == - (na:= subtractIfCan(x.acomp, y.acomp)) case "failed" => "failed" - (nb:= subtractIfCan(x.bcomp, y.bcomp)) case "failed" => "failed" - [na::A,nb::B] + subtractIfCan(x, y) == + (na:= subtractIfCan(x.acomp, y.acomp)) case nothing => nothing + (nb:= subtractIfCan(x.bcomp, y.bcomp)) case nothing => nothing + just [na::A,nb::B] if A has AbelianGroup and B has AbelianGroup then - x == [- x.acomp,-x.bcomp] |