Conversation

Trying to avoid having top level commands in my dependently typed language. It's frustrating that you can't give a type to a signature easily! You need manifest fields or singletons or identity type trickery to make certain definitions public, or else you limit expressiveness. 🤔
2
8
You can't simply elaborate your program to a record term and a record type - you need to be able to check the record type while also knowing some of the definitions in the record term.
1
1
Replying to
Been looking at some Zhaohui Luo's past papers on records and manifest fields which seem relevant, but I'm still trying to see how other languages handle it. Signature privacy definitely seems pretty finicky in dependently typed languages. Curious if anyone has more pointers!
1
1
Like, this kind of suggests that I might not _have_ to build singletons into my core type theory? But I might still need to do subtyping somehow, which could make type inference more painful. 😬
Replying to
I think this error is fine…seems like the issue is that signatures aren’t explicit about which types are opaque/existential. You need to know which U32s to pack as As and which to leave alone (or which As to inline as U32). So why not require e.g. ‘Vector (pub len) String’ here?
1
That is, it seems analogous to a situation like this expression: pack { Int, (1, 2) } Which is missing a signature to specify which Ints to pack and which to leave alone: as ∃t. t × Int So the compiler is doing something like (erroneously) guessing ∃t. t × t.
1
Show replies