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

The Maybe hack is incorrect #2

Open
ziman opened this issue Jan 6, 2016 · 0 comments
Open

The Maybe hack is incorrect #2

ziman opened this issue Jan 6, 2016 · 0 comments

Comments

@ziman
Copy link
Owner

ziman commented Jan 6, 2016

The Maybe hack means that Just x compiles to x and Nothing compiles to None. If there's a value v that compiles to None, such as Nothing, then Just v is indistinguishable from Nothing.

12:35 CET < Melvar> > :let foo : Maybe (Maybe a) -> Int; foo Nothing = 0; foo (Just Nothing) = 1; foo (Just (Just _)) = 2
12:35 CET < idris-bot> defined
12:36 CET < Melvar> ↑ Will or will not that function, compiled with idris-py, return 0 if given (Just Nothing)?
12:36 CET < ziman> yeah, it probably will
12:38 CET < ziman> I probably shouldn't abuse Maybe for that
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