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

More general dynamic types #300

Closed
AshleyYakeley opened this issue Jul 22, 2024 · 4 comments
Closed

More general dynamic types #300

AshleyYakeley opened this issue Jul 22, 2024 · 4 comments
Milestone

Comments

@AshleyYakeley
Copy link
Owner

Should be able to support existing DynamicType as well as exceptions (#299)

@AshleyYakeley AshleyYakeley added this to the 0.6 milestone Jul 22, 2024
@AshleyYakeley
Copy link
Owner Author

AshleyYakeley commented Jul 24, 2024

type storable Dynamic; # contains DynamicType

dynamictype T = !"someanchor" of
    # constructors
end;

dynamictype storable T = !"someanchor" of
    # constructors with anchors
end;

@AshleyYakeley
Copy link
Owner Author

AshleyYakeley commented Jul 24, 2024

Existential witness approach:

type Witness {-p,+q};

point.Witness @A <anchor>: Witness A;  # requires anchor uniqueness check

new.Witness @A: Action (Witness A);

datatype Subtype -a +b of
    Mk of
        subtype a <: b;
    end;
end;

testSubtype: Witness -a -> Witness +b -> Maybe (Subtype a b);

datatype Dynamic of
    Mk of
        type A;
        tw: Witness {-A,+A};
        val: A;
    end;
end;

@AshleyYakeley
Copy link
Owner Author

Existing DynamicType can be replaced by predicate types (#71).

General dynamic types probably can't be storable.

@AshleyYakeley
Copy link
Owner Author

Will do #303 instead.

@AshleyYakeley AshleyYakeley closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant