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

Type parameters #38

Open
cqcallaw opened this issue Jan 11, 2016 · 7 comments
Open

Type parameters #38

cqcallaw opened this issue Jan 11, 2016 · 7 comments
Milestone

Comments

@cqcallaw
Copy link
Owner

cqcallaw commented Jan 11, 2016

See also https://gist.github.com/cqcallaw/6de8bbb25599a1a71d34c7638ef40fe7

@cqcallaw
Copy link
Owner Author

This would be particularly interesting in combination with tagged unions, something like (placeholder syntax):

struct error {
    code:int
    message:string
}

sum result {
    value:int
    error:error
}

@cqcallaw cqcallaw added this to the 0.2 milestone Dec 30, 2017
@cqcallaw
Copy link
Owner Author

cqcallaw commented Jan 4, 2018

Classic C-family <t_arg1, t_arg> syntax is ambiguous for function invocation expressions.

@cqcallaw
Copy link
Owner Author

cqcallaw commented Jan 6, 2018

Options seem to be:

  1. Use different bracketing symbols
  2. Put the type arguments inside the existing argument list, separated from value args by some separator (e.g. (t_arg1, t_arg2 & v_arg1:type, v_arg2:type) -> t_arg1 { })
  3. Make types first-class citizens

@cqcallaw
Copy link
Owner Author

So far, using of <t_param1, t_param2> seems best.

@cqcallaw
Copy link
Owner Author

Another consideration: is it legal to vary function variants by type parameters only?

@cqcallaw
Copy link
Owner Author

Also, do type aliases include the type parameters? Right now, I think type aliases should not include type parameters

@cqcallaw
Copy link
Owner Author

cqcallaw commented Mar 7, 2018

Another edge case: parameterized record types with parameterized function members

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant