JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Add generics to function defininitions #171

Open JSAbrahams opened 4 years ago

JSAbrahams commented 4 years ago

Current Issue

We do not have generics for top-level functions, only those within classes. (Note that generics as of creating this issue have not yet been properly implemented in classes either).

High-level description of the feature

So we can have functions like this which are outside a class:

# this function is defined only on types which define the '+' operator
def my_function[A](first: A, second: A) -> A => first + second

Description of potential implementation