Skip to content

Conversation

@wbukowski
Copy link
Collaborator

@wbukowski wbukowski commented Apr 2, 2025

Closes #153

@wbukowski wbukowski marked this pull request as draft April 2, 2025 20:11
@wbukowski wbukowski marked this pull request as ready for review April 2, 2025 20:29
@wbukowski
Copy link
Collaborator Author

Should I reintroduce some of the types (e.g. Pair, Either) as operators as part of this pull request?

@Foxinio
Copy link
Collaborator

Foxinio commented Apr 2, 2025

Should I reintroduce some of the types (e.g. Pair, Either) as operators as part of this pull request?

That's a good idea. We will immediately have some usage that will in small way test your changes.

Copy link
Member

@ppolesiuk ppolesiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes looks good. However, there are two things that need to be fixed:

  • there is no possibility of accessing type-level operator from a module, e.g. M.[+] (if this will be fixed, the TBOpID constructor should not be necessary, TVar will be sufficient)
  • we agreed that allowing definitions like data A + B = ... instead of data [+] A B = ... are misleading: analogous construct on the level of expressions means something completely different (pattern matching against the constructor-level operator). This should be disallowed, at least by some warning.

@rureirureirurei
Copy link

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

Successfully merging this pull request may close these issues.

Type-level infix operators

4 participants