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

Implement type expressions #12

Open
c3d opened this issue Feb 7, 2020 · 0 comments
Open

Implement type expressions #12

c3d opened this issue Feb 7, 2020 · 0 comments

Comments

@c3d
Copy link
Owner

c3d commented Feb 7, 2020

Implement type expressions as documented.

The most important types are:

  • T1 or T2, e.g. for T or error (aka mayfail T)
  • T1 and T2, mostly for traits, e.g. number and ordered
  • not T, mostly for rules that exclude a given set of type, e.g. ln X:not positive is error "Log of negative"

Internally, the compiler currently generates very basic union types using the | operator.

Ideally, we would be able to implement all this in the library only, once the type interface (issue #11) is properly defined. For example:

type T1 or T2 is
    contains Value is T1.contains Value or T2.contains Value
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