Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Type structures #29

@jonhue

Description

@jonhue

Type structures should allow relating types to values.

A type structure is separated into a formal definition (declaration) and instantiations much like type classes.

A type structure consists of a name, a named list of variables it will be instantiated with, and a list of properties/invariants relating the variables that have to be proven for all instantiations (or, alternatively, assumed to be true).

Each instantiation refers to a concrete type, concrete values for each of the variables, and proofs for all invariants.

Example:

structure Monoid<m>(
  e :: m,
  f :: m -> m -> m
) where
  a :: m. e `f` a = a
  a :: m. a `f` e = a
  a :: m, b :: m, c :: m. (a `f` b) `f` c = a `f` (b `f` c)

It still needs to be investigated whether it's worth including invariants in this definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionHas not been decided upon yetproposalNew proposal for the language spec

    Type

    No type

    Projects

    Status

    Discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions