Skip to content

Shape checking #359

Locked Answered by lattner
AriMKatz asked this question in Q&A
Jun 11, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I don't think it will be a feature of the default array type (because it needs to be dynamically resizable), but you can already express shape algebra in types using the parameter system, e.g. you can express types like this:

struct Parameterized[A: Int]:
  fn method[B: Int](self, other: Parameterized[B]) -> Parameterized[A+B]: ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AriMKatz
Comment options

Answer selected by AriMKatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants