Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fitsinto: rework fitsinto to actually do subtyping #48

Merged
2 changes: 1 addition & 1 deletion alicorn-expressions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ local function primitive_operative(fn)
-- )
-- )))
local result_type = const_combinator(unrestricted(value.tuple_type(cons(cons(empty, cu_inf_type), cu_env_type))))
local inferred_type = value.pi(param_type, param_info_explicit, result_type, result_info_pure)
local inferred_type = unrestricted(value.pi(param_type, param_info_explicit, result_type, result_info_pure))
local inferrable_fn = inferrable_term.typed(inferred_type, usage_array(), typed_fn)
-- FIXME: use prim_if here
-- 5: wrap it in an operative type cons and finally an operative cons
Expand Down
12 changes: 6 additions & 6 deletions derivers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local eq = {

local variants_checks = {}
for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local vdata = variants[vname]
local vtype = vdata.type
local vinfo = vdata.info
Expand Down Expand Up @@ -76,7 +76,7 @@ local is = {
local variants = info.variants

for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local chunk = string.format("return function(self) return self.kind == %q end", vkind)

derive_print("derive is: enum chunk: " .. vkind)
Expand Down Expand Up @@ -172,7 +172,7 @@ local pretty_print = {

local variant_printers = {}
for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local vdata = variants[vname]
local vtype = vdata.type
local vinfo = vdata.info
Expand Down Expand Up @@ -238,7 +238,7 @@ local unwrap = {
local variants = info.variants

for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local vdata = variants[vname]
local vtype = vdata.type
local vinfo = vdata.info
Expand Down Expand Up @@ -284,7 +284,7 @@ local as = {
local variants = info.variants

for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local chunk = "return function(self) return pcall(function() return self:unwrap_" .. vname .. "() end) end"

derive_print("derive as: enum chunk: " .. vkind)
Expand Down Expand Up @@ -315,7 +315,7 @@ local function trait_method(trait, method, build_record_function, specialization

local variant_impls = {}
for n, vname in ipairs(variants) do
local vkind = name .. "_" .. vname
local vkind = name .. "." .. vname
local vdata = variants[vname]
local vtype = vdata.type
local vinfo = vdata.info
Expand Down
Loading
Loading