Skip to content

Issue with extending Tuples #169

@montymxb

Description

@montymxb

To start, this was not in the old spec for the language, but is something that is now in the current formal specification (this is related to #168 ).

Writing the following produces a type of (Int,Int) without the extension, and without an error.

type T = (Int,Int) & {Nothing}

Furthermore, if this did work, there is a matter of how we can handle/distinguish a tuple value from a symbol. Take the following for example:

const : T -> T
const(x,y) = Nothing

Passing in (1,1) could work if T was properly extended, but in the case of passing Nothing we have an issue with the extra parameter y for unpacking the tuple. This could be rectified with a single arg, and tuple projection, but now we have an issue of determining the base type of the underlying value, as projections will fail on a value of Nothing with no way to check this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions