erg_compiler 0.6.3

Centimetre: the Erg compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from _erg_nat import Nat
from _erg_result import Error

class Bool(Nat):
    def try_new(b: bool): # -> Result[Nat]
        if b == True or b == False:
            return Bool(b)
        else:
            return Error("Bool can't be other than True or False")

    def __str__(self) -> str:
        if self:
            return "True"
        else:
            return "False"
    def __repr__(self) -> str:
        return self.__str__()