Skip to content

⌨️ Add deftype #381

Open
Open
@TOTBWF

Description

@TOTBWF

Motivation

Currently, the only way to define types is via def foo : type := ..., which has some interesting ramifications regarding fibrancy. In particular, we can't define record types with fields of type I -> A, and instead have to resort to some weird hacks like ext i => A with [], which I think we can all agree is suboptimal. We should probably think about adding a way of defining honest-to-god types, rather than only codes.

Proposal

The proposed syntax is as follows

deftype <typename> <cells> := <definition>

The cells would then desugar to a pi type.

We can just inline these during elaboration to avoid having to change the core, but perhaps there's some value in adding these to the core with some unfolding rules.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions