-
Notifications
You must be signed in to change notification settings - Fork 6
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
Example/Simple.hs doesn't compile #15
Comments
Thank you for taking a look at this! Sorry for the late reply. Wrt. nested matching, I abandoned this because it didn't seem worth it IMO. It gets very complex, and you have to do all sorts of magic to make it work, either using tons of type classes or using As you might have noticed, we have an optics draft PR: #13 . Optics seem to solve the same ergonomicity issue AFAICT. Thanks for showing interest though. |
Wrt. doing |
I fixed the examples (and commented out what doesn't work yet). |
Thanks! |
I first had to remove
-Werror
fromplutarch-core.cabal
in order to get past this unrelated error:Then I got an unbound identifier when loading the example:
Looking at the history, looks like the
UnEf
type family was renamed toEfC
in 8975df7.After performing the rename, I get a kind error instead:
Looking at the kinds involved, I can fix the kind error by replacing
IsEType (EfC ef)
withEfC ef
, but I don't yet have any idea if that makes any sense semantically.With that "fix", I next encounter a type error:
That is,
ERight
's parameter is already aTerm edsl EUnit
, which is what we need on the right-hand-side, so the code can be simplified to:With this second fix,
Example/Simple.hs
finally typechecks! However, the simplified code is not quite equivalent to the previous code, because we are no longer pattern-matching on EUnit. I get the impression that when the example was written, it was possible to write nested patterns withematch
, but that since then,ematch
has been simplified so that only the outermost constructor is concretized. Thus, if we also want to match on theEUnit
inside theERight
, we need a secondematch
call:The text was updated successfully, but these errors were encountered: