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

Source modality boxing could be wrong #400

Open
amosr opened this issue May 22, 2016 · 1 comment
Open

Source modality boxing could be wrong #400

amosr opened this issue May 22, 2016 · 1 comment

Comments

@amosr
Copy link
Contributor

amosr commented May 22, 2016

the current boxing/reboxing for applications might be wrong for this case

countfrom v
 = fold x = v
   then x + 1
 ~> x

countfrom : Int -> Aggregate Int

however, I believe the application rule would let us apply an aggregate to this, because the return type is aggregate.

countfrom 0 : Aggregate Int
countfrom (countfrom 0) : Aggregate Int

countfrom (countfrom 0)
 = fold x = (fold x1 = 0 then x1 + 1 ~> x1)
   then x + 1
 ~> x
 : type error

I must look into this at some point

@amosr
Copy link
Contributor Author

amosr commented Aug 13, 2017

just thinking about this. when we reimplement the typechecker for Sorbet, we want to distinguish this unbox-rebox case: it is valid for Possibly, but not valid for Temporality. you can unbox a Possibly to a pure thing, but you can't turn back time.

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

No branches or pull requests

1 participant