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

Integrate djinn-like code generation #205

Closed
TomMD opened this issue Jul 16, 2020 · 6 comments
Closed

Integrate djinn-like code generation #205

TomMD opened this issue Jul 16, 2020 · 6 comments
Labels

Comments

@TomMD
Copy link

TomMD commented Jul 16, 2020

What do people think about a type-directed code generation via code action?

I imagine an HLS integration of djinn (de-bitrotted) that adds currently in scope type/data/classes to the djinn environment then can update any undefined or perhaps hole with a djinn query.

@pepeiborra
Copy link
Collaborator

This looks quite easy to do with https://hackage.haskell.org/package/djinn-ghc
Ping @serras

@wz1000
Copy link
Collaborator

wz1000 commented Jul 16, 2020

@serras
Copy link
Contributor

serras commented Jul 16, 2020

@pepeiborra please tell me if I can help in any way. I'll give djinn-ghc some love this weekend and ensure it works on newer versions of GHC.

@jneira
Copy link
Member

jneira commented Oct 21, 2020

@TomMD Afaiu the tactic plugin has brought something similar to described here: type-directed code generation via code action.
So maybe the objective of integrate djinn has been somewhat accomplished?

@jneira jneira added the status: needs info Not actionable, because there's missing information label Oct 21, 2020
@isovector
Copy link
Collaborator

The tactics plugin subsumes all of djinn's functionality, as well as provides support for inductive types.

@TomMD
Copy link
Author

TomMD commented Oct 21, 2020

Yep, I was thinking the same thing. Not sure about the UX still, but that's a different ticket.

For those coming here via search consider:

f :: () -> Maybe ()
f a = _

Ask for a code action, you'll have lots of options. Try number 4, Just:

f a = (Just _)

Some extra parentheses and another hole. In my case with nvim I needed to move the cursor to the new hole and re-execute code-action. This time try number 1 a:

f a = (Just a)

The default formatting isn't able to clean this up at this time.

@TomMD TomMD closed this as completed Oct 21, 2020
@jneira jneira removed the status: needs info Not actionable, because there's missing information label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants