summaryrefslogtreecommitdiff
path: root/src/trace_viewer/index.html
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-11-02 18:19:29 +0000
committerAlasdair Armstrong2017-11-02 18:32:34 +0000
commitce3cd80585a943479614e2112b51a631c3e1376b (patch)
treeda3282a43991ffce130da692d0d4fcb9238cb031 /src/trace_viewer/index.html
parent28d471755b0882c5c069a95e07ce6bb9352f06b9 (diff)
Added monomorphism restriction to undefined values.
What does this mean? Basically undefined values can't be created for types that contain free type variables, so for example: undefined : list(int) is good, but undefined : list('a) is bad. The reason we want to do this is because we can't compile them away statically, and this leads to situations where type-checkable code fails in the rewriter and gives horribly confusing error messages that don't relate to code the user wrote at all. As an example the following used to typecheck, but fail in the rewriter with a confusing error message, whereas now the typechecker should reject all cases which would trigger that failure in rewriting. val test : forall ('a:Type). list('a) -> unit effect {wreg, undef} function test xs = { xs_mut = xs; xs_mut = undefined; (* We don't know what kind of undefined 'a is *) () } There's a slight hitch, namely that in the undefined_type functions created by the -undefined_gen option, we do want to allow functions that have polymorphic undefined values, so that we can generate undefined generators for polymorphic datatypes such as: union option ('a:Type) = { Some : 'a, None } These functions are always have a specific form that allows the rewriter to succesfully remove the polymorphic undefined value for the 'a argument for Sone. As such there's a flag in the typechecking environment for polymorphic undefineds that is enabled when it sees a function with the undefined_ name prefix. Also: Fixed some test cases that were broken due to escape effect being added to assert.
Diffstat (limited to 'src/trace_viewer/index.html')
-rw-r--r--src/trace_viewer/index.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/trace_viewer/index.html b/src/trace_viewer/index.html
index 75c5e035..9efcca56 100644
--- a/src/trace_viewer/index.html
+++ b/src/trace_viewer/index.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
- <title>Sail Log Viewer</title>
+ <title>Sail Trace Viewer</title>
<script type="text/javascript">
var exports = {}
</script>