module flavored

Class F_Bool.

When different flavors of the truth matter. Each FBool is an SBool subtype corresponds to a hashable value called its flavor.

Warning

Combining FBool instances of different flavors with bitwise operators will just result in an SBool.


Function truthy(flavor: Hashable)

Returns the truthy FBool of a particular flavor.


Function falsy(flavor: Hashable)

Returns the falsy FBool of a particular flavor.

final class pythonic_fp.booleans.flavored.FBool(witness: object, flavor: Hashable)
Parameters:
  • witness – Determines truthiness of the FBool instance returned.

  • flavor – The flavor of FBool to created.

Returns:

The truthy or falsy FBool instance of a particular flavor.

static __new__(cls, witness: object, flavor: Hashable) FBool
Parameters:
  • witness – Determines truthiness of the FBool instance returned.

  • flavor – The flavor of FBool to created.

Returns:

The truthy or falsy FBool instance of a particular flavor.

__init__(witness: object, flavor: Hashable) None
__repr__() str

Return repr(self).

__invert__() FBool

~self

__and__(other: int) SBool

Return self&value.

__rand__(other: int) SBool

Return value&self.

__or__(other: int) SBool

Return self|value.

__ror__(other: int) SBool

Return value|self.

__xor__(other: int) SBool

Return self^value.

__rxor__(other: int) SBool

Return value^self.

flavor() Hashable
Returns:

The flavor of the FBool.

pythonic_fp.booleans.flavored.truthy(flavor: Hashable) FBool
Parameters:

flavor – Hashable value to determine which singleton flavor to return.

Returns:

The truthy singleton of a particular flavor.

pythonic_fp.booleans.flavored.falsy(flavor: Hashable) FBool
Parameters:

flavor – Hashable value to determine which singleton flavor to return.

Returns:

The falsy singleton of a particular flavor.