Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design and handle first class types #637

Open
1 task
CohenArthur opened this issue Oct 30, 2023 · 2 comments
Open
1 task

Design and handle first class types #637

CohenArthur opened this issue Oct 30, 2023 · 2 comments
Labels
design Issue or concerns regarding jinko's design parser Parser issue typechecker Issue related to typechecking in jinko

Comments

@CohenArthur
Copy link
Member

  • allow creating types on the fly in function arguments
func foo(a: int | bool) {}
func foo(a: type_function("a", int)) {}
func foo(a: type Foo(int, bool)) {}
func foo(a: type IntOrBool = int | bool)) {}

this will require changes to the name resolution, as function arguments will no longer be usage points but also possibly declarations.

we will need to formalize it so that it integrates nicely with the kind system. in Haskell syntax, all types of a function's argument will need to be of kind *

@CohenArthur CohenArthur added parser Parser issue design Issue or concerns regarding jinko's design typechecker Issue related to typechecking in jinko labels Oct 30, 2023
@CohenArthur
Copy link
Member Author

CohenArthur commented Nov 8, 2023

Add following syntax?

type Nothing;

type Maybe[T] =
    | Nothing
    | T;

@CohenArthur
Copy link
Member Author

Add following syntax?

type Maybe[T] =
    | type Nothing
    | type Some(T);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Issue or concerns regarding jinko's design parser Parser issue typechecker Issue related to typechecking in jinko
Projects
None yet
Development

No branches or pull requests

1 participant