| | 157 | [[br]] |
| | 158 | |
| | 159 | |
| | 160 | == !EffectDecl == |
| | 161 | |
| | 162 | {{{ |
| | 163 | EffectDecl |
| | 164 | ::= effect ECon :: Kind |
| | 165 | }}} |
| | 166 | |
| | 167 | Defines a new effect constructor and sets its kind. The result kind of the constructor must be !. |
| | 168 | |
| | 169 | Inference involving effect constructors of kinds other than {{{!}}} and {{{(% -> !)}}} is not well tested #89. |
| | 170 | |
| | 171 | [[br]] |
| | 172 | |
| | 173 | == !RegionDecl == |
| | 174 | |
| | 175 | {{{ |
| | 176 | RegionDecl |
| | 177 | ::= region RVar (:- TyConstraint ,TyConstraint*)? |
| | 178 | }}} |
| | 179 | |
| | 180 | Defines a top-level (global) region. |
| | 181 | |
| | 182 | Although explicitly binding top-level region variables is not nessesary, it can be useful to define the constraints on a global region in a single place in the source file, instead of trying to repeat them in each type signature that uses it. For example: |
| | 183 | |
| | 184 | {{{ |
| | 185 | region %r :- Const %r |
| | 186 | |
| | 187 | pi :: Float %r |
| | 188 | pi = 3.1415926535 |
| | 189 | |
| | 190 | e :: Float %r |
| | 191 | e = 2.71828183 |
| | 192 | }}} |
| | 193 | |
| | 194 | [[br]] |
| | 195 | |
| | 196 | == !ClassDecl == |
| | 197 | |
| | 198 | {{{ |
| | 199 | ClassDecl |
| | 200 | ::= class Con :: Kind -- abstract class constraint |
| | 201 | | class Con TyVar+ where { TypeSig;+ } -- value type class definition |
| | 202 | }}} |
| | 203 | |
| | 204 | The return kind of abstract class constraints must be {{{+}}}. We don't yet support default instances in type class declarations #90. |