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 synonyms #68

Open
gardspirito opened this issue Aug 19, 2023 · 2 comments
Open

Type synonyms #68

gardspirito opened this issue Aug 19, 2023 · 2 comments

Comments

@gardspirito
Copy link
Contributor

Can/will type synonyms be added to FFG? And how they should be designed?

I'm willing to implement them if they belong here, but I'm unsure how exactly.
At my fork, I attempted to implement type synonyms as a part of let bindings:

let x = 3
type Test a = List a
let y : Test Natural = [x]
in y

... and while it works perfectly, it doesn't work with module system at all, so there's no way to move type declarations to another file.

@imalsogreg
Copy link
Contributor

imalsogreg commented Aug 24, 2023

Linking to some prior discussion on this topic: #53

(one big difference is that #53 is talking about adding builtin type synonyms, while it looks like you want user-defined type synonyms)

@gardspirito
Copy link
Contributor Author

Well, my current implementation unwraps user types at type checking/subtype checking, at the end type introduction scope. And it generally works. The problem is just about modularity. How to make type synonyms the way it's possible to place them in the library and then reuse, because when you import something in FFG, you import an expression, and something of type Type is not an expression in FFG.

The only logical solution that I see is, well, allow expressions at type-level, but I'm not sure about the consequences of it all, and it seems not that easy to implement.

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

No branches or pull requests

2 participants