diff options
| author | Alasdair Armstrong | 2017-08-16 19:26:04 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-16 19:26:04 +0100 |
| commit | 9f013687086937df8be81dd6a0ebd86fc750abf7 (patch) | |
| tree | 91c60d0b9f363bdffe3ac1b1d440b839162dd819 /src/ast_util.mli | |
| parent | 3a61ca53dd501b501bcc6e076aac11243c38880a (diff) | |
Added the feature to bind type variables in patterns.
The reason you want this is to do something like (note new parser only):
*********
default Order dec
type bits 'n:Int = vector('n - 1, 'n, dec, bit)
val zeros : forall 'n. atom('n) -> bits('n)
val decode : bool -> unit
function decode b = {
let 'datasize: {|32, 64|} = if b then 32 else 64;
let imm: bits('datasize) = zeros(datasize);
()
}
*********
for the ASL decode functions, where the typechecker now knows that the
datasize variable and the length of imm are the same.
Diffstat (limited to 'src/ast_util.mli')
| -rw-r--r-- | src/ast_util.mli | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ast_util.mli b/src/ast_util.mli index ae340839..94f3f0cc 100644 --- a/src/ast_util.mli +++ b/src/ast_util.mli @@ -86,6 +86,8 @@ val string_of_index_range : index_range -> string val id_of_fundef : 'a fundef -> id +val id_of_kid : kid -> id + module Id : sig type t = id val compare : id -> id -> int |
