From 5bd0bc2d8d27b665b8aae65fee093adbd2172dd5 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 2 Mar 2012 09:54:15 +0000 Subject: * algebra/catdef.spad.pamphlet (MonoidOperation): Noew CoercibleTo SemiGroupOperation T. --- src/algebra/catdef.spad.pamphlet | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/algebra/catdef.spad.pamphlet') diff --git a/src/algebra/catdef.spad.pamphlet b/src/algebra/catdef.spad.pamphlet index 997b4bba..8562e269 100644 --- a/src/algebra/catdef.spad.pamphlet +++ b/src/algebra/catdef.spad.pamphlet @@ -121,14 +121,17 @@ MonoidOperatorCategory(T: BasicType): Category == ++ Description: ++ This domain implements monoid operations. MonoidOperation(T: BasicType): Public == Private where - Public == Join(MonoidOperatorCategory T,SetCategory) with + Public == Join(MonoidOperatorCategory T,SetCategory,_ + CoercibleTo SemiGroupOperation T) with monoidOperation: ((T,T) -> T, T) -> % ++ \spad{monoidOperation(f,e)} constructs a operation from ++ the binary mapping \spad{f} with neutral value \spad{e}. - Private == Pair((T,T) -> T,T) add - monoidOperation(f,e) == per pair(f,e) + Private == Pair(SemiGroupOperation T,T) add + monoidOperation(f,e) == per pair(semiGroupOperation f,e) elt(op,x,y) == first(rep op)(x,y) neutralValue op == second rep op + coerce(f: %): SemiGroupOperation T == first rep f + @ -- cgit v1.2.3