#cython: language_level=3, annotation_typing=True, c_string_encoding=utf-8, binding=True
# THIS FILE IS GENERATED - DO NOT EDIT #

from typing import Any
from collections.abc import Generator
import cython  # type: ignore
from cython import (declare as cdecl, address as caddr, sizeof as csizeof, typeof as ctypeof, struct as cstruct, 
                    union as cunion, typedef as ctypedef, cast as ccast, char as cchar, short as cshort, int as cint,
                    double as cdouble, long as clong, longlong as clonglong)

from pyrsistent import (
    pset, 
    pmap, 
    pvector, 
    s, v, m
)
from Aspidites.woma import *
from Aspidites._vendor import (
    take,
    drop,
    takelast,
    droplast,
    consume,
    nth,         
    first_true,  
    iterate,     
    padnone,     
    ncycles,     
    repeatfunc,  
    grouper,     
    group_by,    
    roundrobin,  
    partition,   
    splitat,     
    splitby,     
    powerset,    
    pairwise,    
    iter_suppress,
    flatten,     
    accumulate,  
    reduce,      
    filterfalse, 
    zip_longest,
    call,   
    apply,  
    flip,   
    curry,  
    zipwith,
    foldl,  
    foldr,  
    unfold,
    match,
    _,
)
from Aspidites.monads import Maybe, Surely
from Aspidites.math import Undefined, SafeDiv, SafeExp, SafeMod, SafeFloorDiv, SafeUnaryAdd, SafeUnarySub, SafeFactorial
from Aspidites._vendor.contracts import contract, new_contract
from Aspidites._vendor.RestrictedPython import safe_builtins
safe_builtins['print'] = print
from Aspidites._vendor.RestrictedPython import compile_restricted as compile
safe_builtins['compile'] = compile
# DECLARATIONS TO ALLOW CONTRACTS TO TYPE CHECK #
procedure: None
coroutine: Generator
number: Any
globals().update(dict(__builtins__=safe_builtins))  # add all imports to globals


@contract()
@cython.binding(True)
def Add(x : 'number' = 0, y : 'number' = 0) -> 'number':
    return x+y


@contract()
@cython.binding(True)
def Sub(x : 'number' = 0, y : 'number' = 0) -> 'number':
    return x-y


@contract()
@cython.binding(True)
def Div(x : 'number' = 0, y : 'number' = 0) -> 'number':
    return Maybe(SafeDiv, x, y)()


@contract()
@cython.binding(True)
def Exp(x : 'number' = 0, y : 'number' = 0) -> 'number':
    return Maybe(SafeExp, x, y)()


@contract()
@cython.binding(True)
def Mod(x : 'number' = 0, y : 'number' = 0) -> 'number':
    return Maybe(SafeMod, x, y)()


