[Imprint][Data Privacy Statement][E-Mail]

Back to main index. View the specification. View theorem base summary, View theorem base listing, the used properties by spec, the dependency list, the symbol table,

Specification either
specification
   using option
   data types 
      Either[A, B] = Left(. getL : A)
                   | Right(. getR : B) with  . isRight
                   ;
   
   variables 
       either : Either[A, B];
       a : A;
       b : B;
       getL : A;
       getR : B;
   
   functions 
       . mapl ( . ) : Either[A, B] × (A → C) → Either[C, B];
       . mapr ( . ) : Either[A, B] × (B → C) → Either[A, C];
       . map ( . ) : Either[A, B] × (A → C) × (B → D) → Either[C, D];
       . fold ( . ) : Either[A, B] × (A → C) × (B → C) → C;
       . getLOrElse ( . ) : Either[A, B] × A → A;
       . getROrElse ( . ) : Either[A, B] × B → B;
       . optl : Either[A, B] → Option[A];
       . optr : Either[A, B] → Option[B];
   
   variables 
       a : A;
       b : B;
       c : C;
       d : D;
       oa : Option[A];
       ob : Option[B];
       fac : A → C;
       fbc : B → C;
       fbd : B → D;
   
   axioms 
      mapl-left: Left(a).mapl(fac) = Left(fac(a));
      used for: s, ls;
      
      mapl-right: Right(b).mapl(fac) = Right(b);
      used for: s, ls;
      
      mapr-left: Left(a).mapr(fbc) = Left(a);
      used for: s, ls;
      
      mapr-right: Right(b).mapr(fbc) = Right(fbc(b));
      used for: s, ls;
      
      map-left: Left(a).map(fac, fbd) = Left(fac(a));
      used for: s, ls;
      
      map-right: Right(b).map(fac, fbd) = Right(fbd(b));
      used for: s, ls;
      
      fold-left: Left(a).fold(fac, fbc) = fac(a);
      used for: s, ls;
      
      fold-right: Right(b).fold(fac, fbc) = fbc(b);
      used for: s, ls;
      
      optl-left: Left(a).optl = Some(a);
      used for: s, ls;
      
      optl-right: Right(b).optl = None;
      used for: s, ls;
      
      optr-left: Left(a).optr = None;
      used for: s, ls;
      
      optr-right: Right(b).optr = Some(b);
      used for: s, ls;
      
      getLOrElse-left: Left(a).getLOrElse(a0) = a;
      
      getLOrElse-right: Right(b).getLOrElse(a0) = a0;
      
      getROrElse-left: Left(a).getROrElse(b0) = b0;
      
      getROrElse-right: Right(b).getROrElse(b0) = b;
   
   
end specification