Skip to content

Combining constraints with intersection type #27

Closed Answered by Iltotore
mcallisto asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
the use of intersection here is impossible in its current state because intersection is commutative leading to an implicit ambiguity error (multiple possibilities).

Instead, you can use the &&[A, B] alias of And:

type +>[A, B] = A ==> Greater[A] && Even[B]

EDIT: Marked as answer. Check the below comments.

Replies: 1 comment 16 replies

Comment options

You must be logged in to vote
16 replies
@Iltotore
Comment options

@mcallisto
Comment options

@Iltotore
Comment options

@mcallisto
Comment options

@Iltotore
Comment options

Answer selected by Iltotore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants