Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.15 KB

semigroups.rst

File metadata and controls

40 lines (27 loc) · 1.15 KB

Semigroups *********

from pymonet.semigroups import All, First, Map, Sum

All(True).concat(All(False))  # All<False>
All(True).concat(All(True))  # All<True>

All(True) == All(True)  # True
All(True) == All(False)  # False

ingredient1 = Map({'score': Sum(1), 'won': All(True), 'captain': First('captain america')})
ingredient2 = Map({'score': Sum(2), 'won': All(True), 'captain': First('iron man')})
ingredient1.concat(ingredient2)  # Map<{'score': Sum(3), 'won': All(True), 'captain': First('captain america')}>

pymonet.semigroups.All

pymonet.semigroups.One

pymonet.semigroups.First

pymonet.semigroups.Last

pymonet.semigroups.Map

pymonet.semigroups.Max

pymonet.semigroups.Min