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

Better translator support for recursion under type constructors #901

Open
IlmariReissumies opened this issue Aug 10, 2022 · 0 comments
Open

Comments

@IlmariReissumies
Copy link
Member

The translator currently only supports recursion under type constructors for a few hard-coded types pair, option and list.

For a minimal example, consider these types:

Datatype:
  container = Container 'a
End

Datatype:
  thing = NonThing | Thing (thing container)
End

Datatype:
  thing2 = NonThing2 | Thing2 (thing2 option)
End

register_type accepts thing2, but not thing.

The first place where it fails is a tDefine somewhere deep in define_ref_inv, where unless the type constructor is in {pair,option,list}, the recursive invocation of THING_TYPE is not eta-expanded properly before being passed to tDefine.

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