-
-
Save bChiquet/a964266d47cb893badfce19f5c458e84 to your computer and use it in GitHub Desktop.
Quoted from parser.y
This file contains hidden or 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
Coeffect :: { Coeffect } | |
: INT { let TokenInt _ x = $1 in CNat x } | |
| '∞' { infinity } | |
| FLOAT { let TokenFloat _ x = $1 in CFloat $ myReadFloat x } | |
| CONSTR { case (constrString $1) of | |
"Public" -> Level publicRepresentation | |
"Private" -> Level privateRepresentation | |
"Unused" -> Level unusedRepresentation | |
"Inf" -> infinity | |
x -> error $ "Unknown coeffect constructor `" <> x <> "`" } | |
| VAR { CVar (mkId $ symString $1) } | |
| Coeffect '..' Coeffect { CInterval $1 $3 } | |
| Coeffect '+' Coeffect { CPlus $1 $3 } | |
| Coeffect '*' Coeffect { CTimes $1 $3 } | |
| Coeffect '-' Coeffect { CMinus $1 $3 } | |
| Coeffect '^' Coeffect { CExpon $1 $3 } | |
| Coeffect "/\\" Coeffect { CMeet $1 $3 } | |
| Coeffect "\\/" Coeffect { CJoin $1 $3 } | |
| '(' Coeffect ')' { $2 } | |
| '{' Set '}' { CSet $2 } | |
| Coeffect ':' Type { normalise (CSig $1 $3) } | |
| '(' Coeffect ',' Coeffect ')' { CProduct $2 $4 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment