Simplify snapshot format for external modules

This commit is contained in:
Richard Feldman 2025-10-21 08:24:22 -04:00
parent 204f1d9a93
commit e929920592
No known key found for this signature in database
41 changed files with 162 additions and 191 deletions

View file

@ -654,15 +654,18 @@ pub const Expr = union(enum) {
try ir.appendRegionInfoToSExprTreeFromRegion(tree, e.region);
const attrs = tree.beginNode();
// Add module index
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{@intFromEnum(e.module_idx)}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
// Add target node index
var buf2: [32]u8 = undefined;
const target_idx_str = std.fmt.bufPrint(&buf2, "{}", .{e.target_node_idx}) catch unreachable;
try tree.pushStringPair("target-node-idx", target_idx_str);
// Add module name (get from imports)
const module_idx_int = @intFromEnum(e.module_idx);
if (module_idx_int < ir.imports.imports.items.items.len) {
const string_lit_idx = ir.imports.imports.items.items[module_idx_int];
const module_name = ir.common.strings.get(string_lit_idx);
try tree.pushStringPair("module", module_name);
} else {
// Fallback to numeric index if out of bounds
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{module_idx_int}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
}
try tree.endNode(begin, attrs);
},
@ -829,15 +832,18 @@ pub const Expr = union(enum) {
try ir.appendRegionInfoToSExprTreeFromRegion(tree, region);
const attrs = tree.beginNode();
// Add module index
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{@intFromEnum(e.module_idx)}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
// Add target node index
var buf2: [32]u8 = undefined;
const target_idx_str = std.fmt.bufPrint(&buf2, "{}", .{e.target_node_idx}) catch unreachable;
try tree.pushStringPair("target-node-idx", target_idx_str);
// Add module name (get from imports)
const module_idx_int = @intFromEnum(e.module_idx);
if (module_idx_int < ir.imports.imports.items.items.len) {
const string_lit_idx = ir.imports.imports.items.items[module_idx_int];
const module_name = ir.common.strings.get(string_lit_idx);
try tree.pushStringPair("module", module_name);
} else {
// Fallback to numeric index if out of bounds
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{module_idx_int}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
}
try ir.store.getExpr(e.backing_expr).pushToSExprTree(ir, tree, e.backing_expr);

View file

@ -352,15 +352,18 @@ pub const Pattern = union(enum) {
try tree.pushStaticAtom("p-nominal-external");
try ir.appendRegionInfoToSExprTree(tree, pattern_idx);
// Add module index
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{@intFromEnum(n.module_idx)}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
// Add target node index
var buf2: [32]u8 = undefined;
const target_idx_str = std.fmt.bufPrint(&buf2, "{}", .{n.target_node_idx}) catch unreachable;
try tree.pushStringPair("target-node-idx", target_idx_str);
// Add module name (get from imports)
const module_idx_int = @intFromEnum(n.module_idx);
if (module_idx_int < ir.imports.imports.items.items.len) {
const string_lit_idx = ir.imports.imports.items.items[module_idx_int];
const module_name = ir.common.strings.get(string_lit_idx);
try tree.pushStringPair("module", module_name);
} else {
// Fallback to numeric index if out of bounds
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{module_idx_int}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
}
const attrs = tree.beginNode();
try ir.store.getPattern(n.backing_pattern).pushToSExprTree(ir, tree, n.backing_pattern);

View file

@ -122,21 +122,18 @@ pub const TypeAnno = union(enum) {
try tree.endNode(field_begin, field_attrs);
},
.external => |external| {
const ext_begin = tree.beginNode();
try tree.pushStaticAtom("external");
// Add module index
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{@intFromEnum(external.module_idx)}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
// Add target node index
var buf2: [32]u8 = undefined;
const target_idx_str = std.fmt.bufPrint(&buf2, "{}", .{external.target_node_idx}) catch unreachable;
try tree.pushStringPair("target-node-idx", target_idx_str);
const field_attrs = tree.beginNode();
try tree.endNode(ext_begin, field_attrs);
// Just output the module name directly
const module_idx_int = @intFromEnum(external.module_idx);
if (module_idx_int < ir.imports.imports.items.items.len) {
const string_lit_idx = ir.imports.imports.items.items[module_idx_int];
const module_name = ir.common.strings.get(string_lit_idx);
try tree.pushStringPair("module", module_name);
} else {
// Fallback to numeric index if out of bounds
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{module_idx_int}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
}
},
}
@ -193,21 +190,18 @@ pub const TypeAnno = union(enum) {
try tree.endNode(field_begin, field_attrs);
},
.external => |external| {
const ext_begin = tree.beginNode();
try tree.pushStaticAtom("external");
// Add module index
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{@intFromEnum(external.module_idx)}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
// Add target node index
var buf2: [32]u8 = undefined;
const target_idx_str = std.fmt.bufPrint(&buf2, "{}", .{external.target_node_idx}) catch unreachable;
try tree.pushStringPair("target-node-idx", target_idx_str);
const field_attrs = tree.beginNode();
try tree.endNode(ext_begin, field_attrs);
// Just output the module name directly
const module_idx_int = @intFromEnum(external.module_idx);
if (module_idx_int < ir.imports.imports.items.items.len) {
const string_lit_idx = ir.imports.imports.items.items[module_idx_int];
const module_name = ir.common.strings.get(string_lit_idx);
try tree.pushStringPair("module", module_name);
} else {
// Fallback to numeric index if out of bounds
var buf: [32]u8 = undefined;
const module_idx_str = std.fmt.bufPrint(&buf, "{}", .{module_idx_int}) catch unreachable;
try tree.pushStringPair("module-idx", module_idx_str);
}
},
}

View file

@ -159,21 +159,17 @@ EndOfFile,
(e-num (value "2")))
(e-binop (op "and")
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False"))))
(e-binop (op "or")
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True"))))
(e-binop (op "null_coalesce")
(e-tag (name "None"))

View file

@ -745,7 +745,7 @@ combineResults = |jsonResult, httpStatus|
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Str") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-malformed)
(ty-malformed))))))
(d-let
@ -823,7 +823,7 @@ combineResults = |jsonResult, httpStatus|
(ty-malformed)
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-malformed))))))
@ -840,7 +840,7 @@ combineResults = |jsonResult, httpStatus|
(declared-type
(ty-fn (effectful false)
(ty-malformed)
(ty-lookup (name "Client") (external (module-idx "5") (target-node-idx "0")))))))
(ty-lookup (name "Client") (module "http.Client"))))))
(d-let
(p-assign (ident "handleResponse"))
(e-closure
@ -926,11 +926,11 @@ combineResults = |jsonResult, httpStatus|
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-malformed)
(ty-malformed))
(ty-malformed)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-malformed)
(ty-malformed))))))
(s-alias-decl

View file

@ -547,7 +547,7 @@ validateAuth = |creds| HttpAuth.validate(creds)
(ty-fn (effectful false)
(ty-malformed)
(ty-lookup (name "Str") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Str") (builtin))
(ty-malformed))))))
(d-let
@ -578,7 +578,7 @@ validateAuth = |creds| HttpAuth.validate(creds)
(declared-type
(ty-fn (effectful false)
(ty-malformed)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-malformed)
(ty-malformed))))))
(s-import (module "json.Parser")

View file

@ -482,7 +482,7 @@ combineResults = |result1, result2|
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Str") (builtin))
(ty-lookup (name "Value") (external (module-idx "5") (target-node-idx "0")))))))
(ty-lookup (name "Value") (module "json.Json"))))))
(d-let
(p-assign (ident "handleApi"))
(e-closure
@ -530,16 +530,16 @@ combineResults = |result1, result2|
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Request") (external (module-idx "4") (target-node-idx "0")))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-lookup (name "Response") (external (module-idx "4") (target-node-idx "0")))
(ty-lookup (name "Error") (external (module-idx "5") (target-node-idx "0"))))))))
(ty-lookup (name "Request") (module "http.Client"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Response") (module "http.Client"))
(ty-lookup (name "Error") (module "json.Json")))))))
(d-let
(p-assign (ident "config"))
(e-runtime-error (tag "ident_not_in_scope"))
(annotation
(declared-type
(ty-lookup (name "Config") (external (module-idx "5") (target-node-idx "0"))))))
(ty-lookup (name "Config") (module "json.Json")))))
(d-let
(p-assign (ident "advancedParser"))
(e-lambda
@ -557,8 +557,8 @@ combineResults = |result1, result2|
(ty-fn (effectful false)
(ty-malformed)
(ty-lookup (name "Str") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-lookup (name "Value") (external (module-idx "5") (target-node-idx "0")))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Value") (module "json.Json"))
(ty-malformed))))))
(d-let
(p-assign (ident "combineResults"))
@ -623,13 +623,13 @@ combineResults = |result1, result2|
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var (name "a"))
(ty-rigid-var (name "err")))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var (name "b"))
(ty-rigid-var-lookup (ty-rigid-var (name "err"))))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-tuple
(ty-rigid-var-lookup (ty-rigid-var (name "a")))
(ty-rigid-var-lookup (ty-rigid-var (name "b"))))

View file

@ -251,7 +251,7 @@ NO CHANGE
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "InvalidType") (external (module-idx "4") (target-node-idx "0")))
(ty-lookup (name "InvalidType") (module "json.Json"))
(ty-lookup (name "Str") (builtin))))))
(d-let
(p-assign (ident "processRequest"))

View file

@ -47,12 +47,10 @@ NO CHANGE
(e-tag (name "True"))
(e-tag (name "False"))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))
(e-unary-not
(e-tag (name "True")))

View file

@ -2358,7 +2358,7 @@ expect {
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-record)
(ty-underscore))))))
(d-let

View file

@ -2091,7 +2091,7 @@ expect {
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-record)
(ty-underscore))))))
(d-let

View file

@ -37,8 +37,7 @@ NO CHANGE
(if-branches
(if-branch
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))
(e-tag (name "Ok")
(args

View file

@ -135,7 +135,7 @@ nested = { bar: A, count: 1 }
(e-tag (name "A"))))
(annotation
(declared-type
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Foo.Bar") (local))
(ty-lookup (name "Foo.Error") (local))))))
(d-let

View file

@ -120,7 +120,7 @@ handleResult = |result| {
(branch
(patterns
(pattern (degenerate false)
(p-nominal-external (module-idx "4") (target-node-idx "0")
(p-nominal-external (module "MyResultModule")
(p-applied-tag))))
(value
(e-lookup-local
@ -128,7 +128,7 @@ handleResult = |result| {
(branch
(patterns
(pattern (degenerate false)
(p-nominal-external (module-idx "4") (target-node-idx "0")
(p-nominal-external (module "MyResultModule")
(p-applied-tag))))
(value
(e-string
@ -136,7 +136,7 @@ handleResult = |result| {
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "MyResultType") (external (module-idx "4") (target-node-idx "0"))
(ty-apply (name "MyResultType") (module "MyResultModule")
(ty-lookup (name "Str") (builtin))
(ty-lookup (name "I32") (builtin)))
(ty-lookup (name "Str") (builtin))))))

View file

@ -53,12 +53,11 @@ NO CHANGE
(d-let
(p-assign (ident "red"))
(e-nominal-external
(module-idx "4")
(target-node-idx "0")
(module "Color")
(e-tag (name "Red")))
(annotation
(declared-type
(ty-lookup (name "RGB") (external (module-idx "4") (target-node-idx "0"))))))
(ty-lookup (name "RGB") (module "Color")))))
(s-import (module "Color")
(exposes)))
~~~

View file

@ -95,8 +95,7 @@ isRed = |color| match color {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -105,8 +104,7 @@ isRed = |color| match color {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))
(branch
(patterns
@ -114,14 +112,13 @@ isRed = |color| match color {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Color") (local))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(s-nominal-decl
(ty-header (name "Color"))
(ty-tag-union

View file

@ -64,8 +64,7 @@ blue = CC.Color.RGB(0, 0, 255)
(d-let
(p-assign (ident "blue"))
(e-nominal-external
(module-idx "4")
(target-node-idx "0")
(module "styles.Color")
(e-tag (name "RGB")
(args
(e-num (value "0"))
@ -73,7 +72,7 @@ blue = CC.Color.RGB(0, 0, 255)
(e-num (value "255")))))
(annotation
(declared-type
(ty-lookup (name "Color") (external (module-idx "4") (target-node-idx "0"))))))
(ty-lookup (name "Color") (module "styles.Color")))))
(s-import (module "styles.Color")
(exposes)))
~~~

View file

@ -140,8 +140,7 @@ is_ok = |result| match result {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -150,8 +149,7 @@ is_ok = |result| match result {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
@ -159,7 +157,7 @@ is_ok = |result| match result {
(ty-apply (name "MyResult") (local)
(ty-rigid-var (name "_ok"))
(ty-rigid-var (name "_err")))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(s-nominal-decl
(ty-header (name "MyResult")
(ty-args

View file

@ -116,8 +116,7 @@ isRed = |color| match color {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -126,8 +125,7 @@ isRed = |color| match color {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))
(branch
(patterns
@ -136,14 +134,13 @@ isRed = |color| match color {
(p-applied-tag))))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Color") (local))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(s-nominal-decl
(ty-header (name "Color"))
(ty-tag-union

View file

@ -95,8 +95,7 @@ isRed = |color| match color {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -104,8 +103,7 @@ isRed = |color| match color {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))
(branch
(patterns
@ -113,14 +111,13 @@ isRed = |color| match color {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Color") (local))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(s-nominal-decl
(ty-header (name "Color"))
(ty-tag-union

View file

@ -129,8 +129,7 @@ isOk = |result| match result {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -138,8 +137,7 @@ isOk = |result| match result {
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
@ -147,7 +145,7 @@ isOk = |result| match result {
(ty-apply (name "MyResult") (local)
(ty-rigid-var (name "ok"))
(ty-rigid-var (name "err")))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(s-nominal-decl
(ty-header (name "MyResult")
(ty-args

View file

@ -331,7 +331,7 @@ transform = |_, b| b
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-underscore)
(ty-lookup (name "Str") (builtin)))
(ty-lookup (name "Str") (builtin))))))

View file

@ -891,7 +891,7 @@ is_named_color = |str| {
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Str") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Color") (local))
(ty-tag-union
(ty-tag-name (name "InvalidHex")
@ -1032,7 +1032,7 @@ is_named_color = |str| {
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Str") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Color") (local))
(ty-tag-union
(ty-tag-name (name "UnknownColor")

View file

@ -501,16 +501,15 @@ transform = |result|
(e-runtime-error (tag "undeclared_type"))
(annotation
(declared-type
(ty-lookup (name "RGB") (external (module-idx "4") (target-node-idx "0"))))))
(ty-lookup (name "RGB") (module "Color")))))
(d-let
(p-assign (ident "aliasedQualified"))
(e-nominal-external
(module-idx "6")
(target-node-idx "0")
(module "ExternalModule")
(e-tag (name "Default")))
(annotation
(declared-type
(ty-lookup (name "DataType") (external (module-idx "6") (target-node-idx "0"))))))
(ty-lookup (name "DataType") (module "ExternalModule")))))
(d-let
(p-assign (ident "multiLevelQualified"))
(e-runtime-error (tag "ident_not_in_scope"))
@ -520,14 +519,13 @@ transform = |result|
(d-let
(p-assign (ident "resultType"))
(e-nominal-external
(module-idx "3")
(target-node-idx "3")
(module "Result")
(e-tag (name "Ok")
(args
(e-num (value "42")))))
(annotation
(declared-type
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "I32") (builtin))
(ty-lookup (name "Str") (builtin))))))
(d-let
@ -540,7 +538,7 @@ transform = |result|
(declared-type
(ty-fn (effectful false)
(ty-record)
(ty-lookup (name "RGB") (external (module-idx "4") (target-node-idx "0")))))))
(ty-lookup (name "RGB") (module "Color"))))))
(d-let
(p-assign (ident "processColor"))
(e-lambda
@ -551,7 +549,7 @@ transform = |result|
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "RGB") (external (module-idx "4") (target-node-idx "0")))
(ty-lookup (name "RGB") (module "Color"))
(ty-lookup (name "Str") (builtin))))))
(d-let
(p-assign (ident "transform"))
@ -585,9 +583,9 @@ transform = |result|
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-lookup (name "RGB") (external (module-idx "4") (target-node-idx "0")))
(ty-lookup (name "Error") (external (module-idx "6") (target-node-idx "0"))))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "RGB") (module "Color"))
(ty-lookup (name "Error") (module "ExternalModule")))
(ty-malformed)))))
(s-import (module "Color")
(exposes))

View file

@ -30,8 +30,7 @@ NO CHANGE
(can-ir
(s-dbg
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
~~~
# TYPES

View file

@ -30,8 +30,7 @@ NO CHANGE
(can-ir
(s-expect
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
~~~
# TYPES

View file

@ -68,16 +68,15 @@ foo = |a| {
(e-lookup-local
(p-assign (ident "a")))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(e-lookup-local
(p-assign (ident "a")))))
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1"))))))))
(ty-lookup (name "Bool") (module "Bool"))
(ty-lookup (name "Bool") (module "Bool")))))))
~~~
# TYPES
~~~clojure

View file

@ -42,16 +42,14 @@ NO CHANGE
(d-let
(p-assign (ident "foo"))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True"))))
(s-expect
(e-binop (op "ne")
(e-lookup-local
(p-assign (ident "foo")))
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False"))))))
~~~
# TYPES

View file

@ -30,8 +30,7 @@ NO CHANGE
(can-ir
(s-return
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
~~~
# TYPES

View file

@ -142,7 +142,7 @@ foo = |num| {
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "U64") (builtin))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Str") (builtin))
(ty-tag-union
(ty-tag-name (name "TooBig")))))))))

View file

@ -2277,7 +2277,7 @@ expect {
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-record)
(ty-underscore))))))
(d-let

View file

@ -329,7 +329,7 @@ main! = |_| {
(ty-header (name "ApiResponse")
(ty-args
(ty-rigid-var (name "data"))))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var-lookup (ty-rigid-var (name "data")))
(ty-lookup (name "Str") (builtin))))
(s-alias-decl

View file

@ -298,10 +298,10 @@ main! = |_| processComplex(Ok([Some(42), None]))
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Dict") (external (module-idx "0") (target-node-idx "1"))
(ty-apply (name "Dict") (module "Dict")
(ty-lookup (name "Str") (builtin))
(ty-malformed)))
(ty-apply (name "List") (builtin)
@ -342,10 +342,10 @@ main! = |_| processComplex(Ok([Some(42), None]))
(ty-args
(ty-rigid-var (name "a"))
(ty-rigid-var (name "b"))))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-apply (name "List") (builtin)
(ty-malformed))
(ty-apply (name "Dict") (external (module-idx "0") (target-node-idx "1"))
(ty-apply (name "Dict") (module "Dict")
(ty-lookup (name "Str") (builtin))
(ty-malformed)))))
~~~

View file

@ -106,7 +106,7 @@ NO CHANGE
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Dict") (external (module-idx "0") (target-node-idx "1"))
(ty-apply (name "Dict") (module "Dict")
(ty-lookup (name "Str") (builtin))
(ty-lookup (name "U64") (builtin)))
(ty-apply (name "List") (builtin)

View file

@ -106,7 +106,7 @@ main! = |_| processNested([])
(declared-type
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Str") (builtin))
(ty-malformed)))
(ty-apply (name "List") (builtin)

View file

@ -297,7 +297,7 @@ Complex : {
(ty-lookup (name "Str") (builtin)))
(s-alias-decl
(ty-header (name "MyBool"))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1"))))
(ty-lookup (name "Bool") (module "Bool")))
(s-alias-decl
(ty-header (name "Person"))
(ty-record
@ -337,7 +337,7 @@ Complex : {
(ty-rigid-var-lookup (ty-rigid-var (name "a"))))))))
(s-alias-decl
(ty-header (name "MyResult"))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Str") (builtin))
(ty-lookup (name "U64") (builtin))))
(s-alias-decl
@ -352,7 +352,7 @@ Complex : {
(ty-lookup (name "Str") (builtin))))
(s-alias-decl
(ty-header (name "MyDict"))
(ty-apply (name "Dict") (external (module-idx "0") (target-node-idx "1"))
(ty-apply (name "Dict") (module "Dict")
(ty-lookup (name "Str") (builtin))
(ty-lookup (name "U64") (builtin))))
(s-alias-decl
@ -361,8 +361,8 @@ Complex : {
(field (field "person")
(ty-lookup (name "Person") (local)))
(field (field "result")
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))
(ty-apply (name "Result") (module "Result")
(ty-lookup (name "Bool") (module "Bool"))
(ty-lookup (name "Str") (builtin))))
(field (field "tree")
(ty-apply (name "Tree") (local)

View file

@ -208,7 +208,7 @@ main! = |_| {}
(ty-rigid-var (name "_ok")))
(ty-tag-name (name "Err2")
(ty-rigid-var (name "_err"))))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(d-let
(p-assign (ident "is_ok_ret_bool"))
(e-lambda
@ -226,8 +226,7 @@ main! = |_| {}
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "True")))))
(branch
(patterns
@ -235,8 +234,7 @@ main! = |_| {}
(p-applied-tag)))
(value
(e-nominal-external
(module-idx "2")
(target-node-idx "1")
(module "Bool")
(e-tag (name "False")))))))))
(annotation
(declared-type
@ -246,7 +244,7 @@ main! = |_| {}
(ty-rigid-var (name "_ok2")))
(ty-tag-name (name "Err2")
(ty-rigid-var (name "_err2"))))
(ty-lookup (name "Bool") (external (module-idx "2") (target-node-idx "1")))))))
(ty-lookup (name "Bool") (module "Bool"))))))
(d-let
(p-assign (ident "main!"))
(e-lambda

View file

@ -182,7 +182,7 @@ NO CHANGE
(annotation
(declared-type
(ty-fn (effectful false)
(ty-lookup (name "Result") (external (module-idx "3") (target-node-idx "3")))
(ty-lookup (name "Result") (module "Result"))
(ty-lookup (name "Str") (builtin))))))
(d-let
(p-assign (ident "handleResponse"))
@ -222,7 +222,7 @@ NO CHANGE
(ty-header (name "Response"))
(ty-tag-union
(ty-tag-name (name "Ok")
(ty-lookup (name "Result") (external (module-idx "3") (target-node-idx "3"))))
(ty-lookup (name "Result") (module "Result")))
(ty-tag-name (name "NetworkError"))
(ty-tag-name (name "ParseError"))))
(s-alias-decl

View file

@ -257,14 +257,14 @@ main = |_| "done"
(annotation
(declared-type
(ty-fn (effectful false)
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var (name "a"))
(ty-rigid-var (name "e")))
(ty-parens
(ty-fn (effectful false)
(ty-rigid-var-lookup (ty-rigid-var (name "a")))
(ty-rigid-var (name "b"))))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var-lookup (ty-rigid-var (name "b")))
(ty-rigid-var-lookup (ty-rigid-var (name "e"))))))))
(d-let
@ -330,8 +330,8 @@ main = |_| "done"
(declared-type
(ty-fn (effectful false)
(ty-rigid-var (name "a"))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-apply (name "Result") (module "Result")
(ty-rigid-var-lookup (ty-rigid-var (name "a")))
(ty-lookup (name "Str") (builtin)))
(ty-lookup (name "Str") (builtin)))))))

View file

@ -73,7 +73,7 @@ NO CHANGE
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-lookup (name "U8") (builtin)))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var (name "a"))
(ty-tag-union
(ty-tag-name (name "DecodeErr"))))))))
@ -81,7 +81,7 @@ NO CHANGE
(ty-fn (effectful false)
(ty-apply (name "List") (builtin)
(ty-lookup (name "U8") (builtin)))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var (name "a"))
(ty-tag-union
(ty-tag-name (name "DecodeErr")))))
@ -90,7 +90,7 @@ NO CHANGE
(args
(ty-apply (name "List") (builtin)
(ty-lookup (name "U8") (builtin))))
(ty-apply (name "Result") (external (module-idx "3") (target-node-idx "3"))
(ty-apply (name "Result") (module "Result")
(ty-rigid-var-lookup (ty-rigid-var (name "a")))
(ty-tag-union
(ty-tag-name (name "DecodeErr")))))))