Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Run desugarer (not working) #840

Closed
wants to merge 1 commit into from
Closed

Conversation

georgefst
Copy link
Contributor

A very rudimentary first attempt at solving #107, which is the main thing I still miss from HIE.

This is my first foray in to the internals of Ghcide, and, frankly, I don't know what I'm doing... Although it was marked "good first issue", so I guess I can't be too far off.

Hopefully someone can tell me why this doesn't yet work - I'd expect to see an "incomplete pattern match" warning on:

f = \case
    True -> ()

@georgefst georgefst marked this pull request as draft September 28, 2020 20:25
@wz1000
Copy link
Collaborator

wz1000 commented Sep 28, 2020

Notice that we already have generateCoreRule which does exactly this.

However, I plan to address this in #836

@wz1000
Copy link
Collaborator

wz1000 commented Sep 28, 2020

BTW, the reason this doesn't work is because you don't actually call the rule from anywhere :)

@georgefst
Copy link
Contributor Author

BTW, the reason this doesn't work is because you don't actually call the rule from anywhere :)

Ha, I did wonder about that. Although that would seem to mean that typeCheckRule, which this was based on, isn't called from anywhere either. 😕

Notice that we already have generateCoreRule which does exactly this.

At a glance, the implementation looks quite different - does generateCoreRule go further?

However, I plan to address this in #836

Wow that's weird timing - I'd been meaning to look in to this all year...

@georgefst georgefst closed this Sep 28, 2020
@wz1000
Copy link
Collaborator

wz1000 commented Sep 28, 2020

Ha, I did wonder about that. Although that would seem to mean that typeCheckRule, which this was based on, isn't called from anywhere either. confused

typecheckRule and generateCoreRule merely define the shake rule. They are called when we invoke use Typecheck or use GenerateCore. So to fix your code, you would need to use_ Desugar somewhere.

generateCoreRule is essentially calling compileModule, which calls desugarModule as you did, but also optionally runs the simplifier, and also tidies the Core produced using tidyProgram (which makes the Core suitable for further use for compilation/bytecode generation).

@georgefst
Copy link
Contributor Author

you would need to use_ Desugar somewhere

Aha, of course - thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants