Created
August 21, 2022 01:00
-
-
Save aripiprazole/f5e6f89592dc991fa8b361fa9c0f56d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ekko.tree | |
/** | |
* Types can be quantified by adding a list of predicates [predicates], to restrict | |
* the ways in which type variables is instantiated. | |
* | |
* Example of `Num a => a`(in haskell): | |
* ```kt | |
* val predicates = listOf(IsIn(TVar(Ident("a", KStar), Ident("Num")))) | |
* | |
* Qual(predicates, TVar(Ident("a", KStar))) | |
* ``` | |
*/ | |
data class Qual<A>(val predicates: Set<Pred>, val value: A) | |
sealed interface Pred | |
data class IsIn(val typ: Typ, val id: Ident) : Pred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment