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

Make subtype fn of <?> behaves like (</> (<Assortment> #f) ...) #1108

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

gengar
Copy link
Contributor

@gengar gengar commented Feb 6, 2025

(<?> <boolean>)<boolean> のsubtypeになってくれませんが、 (</> (<Assortment> #f) <boolean>)<boolean> のsubtypeになってくれます。 (subtype? (<?> <char>) (</> <boolean> <char>)) でも同じことが起きます。

gosh$ (subtype? (<?> <boolean>) <boolean>)
#f
gosh$ (subtype? (<?> <char>) (</> <boolean> <char>))
#f
gosh$ (subtype? (</> (<Assortment> #f) <boolean>) <boolean>)
#t
gosh$ (subtype? (</> (<Assortment> #f) <char>) (</> <boolean> <char>))
#t

そこで、 <?> の挙動を (</> (Assortment> #f) ...) に合わせてみました。いかがでしょう。

@shirok
Copy link
Owner

shirok commented Feb 7, 2025

ああ、そうですね。つい Maybe T のように扱ってしまうのですが <?> は実体は#fだけを持つシングルトン型とのユニオン型ですね。

@shirok shirok merged commit 2b8d186 into shirok:master Feb 7, 2025
5 checks passed
@gengar gengar deleted the question-type-subtype branch February 7, 2025 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants