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

Dhall to Cabal #78

Closed
mckeankylej opened this Issue Jun 18, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@mckeankylej
Copy link

mckeankylej commented Jun 18, 2017

I think a dhall-to-cabal library would be great. You would write a dhall record and then run the utility and it would generate you a cabal file. This would allow you to use dhalls abstraction capabilities to write shorter and easy to read dhallcabal files.

There are two ways to accomplish this. You could write a library similar to dhall-nix or you could use the new string interpolation to write an almost totally dhall package!

I am interested in doing this but I have been pressed for time currently at work if no one else does it I will get around to in in a couple weeks. This being said I am curious what you all think the best course of action would be to accomplish this.

On a completely unrelated note that doesn't deserve its own issue. Gabriel, you should consider making dhall a github organization. It is super easy and would allow for you to bless things like dhall-rs, dhall-scala, and dhall-cabal.

@Gabriel439

This comment has been minimized.

Copy link
Collaborator

Gabriel439 commented Jun 18, 2017

Yeah, I will create a GitHub organization soon now that Dhall has enough integrations to warrant it

Generally, I recommend using an approach similar to dhall-nix where you do an AST-to-AST translation so that downstream tools can in theory consume the .cabal file's Haskell AST instead of the text representation. This promotes a "tighter" software pipeline that stays entirely in Haskell and also prevents having to reparse/revalidate the file.

For me, one big benefit that would come out of this is a clearer schema for cabal files in the form of a well-commented Dhall type, because the Cabal user guide is sort of disorganized in presenting this information.

However, if you do decide to go the string interpolation route, note that you can use my recently released dhall-text package so that you don't have to write any Haskell code for the final rendering of the Text value:

@ocharles

This comment has been minimized.

Copy link
Collaborator

ocharles commented Jan 18, 2018

I've begun work on this here: https://github.com/ocharles/dhall-to-cabal. Happy to have some contributors help me.

@sboosali

This comment has been minimized.

Copy link

sboosali commented Jun 22, 2018

Looks like dhall-to-cabal has been released. Should we close this issue?

@Gabriel439

This comment has been minimized.

Copy link
Collaborator

Gabriel439 commented Jun 22, 2018

Yep! Closing

@Gabriel439 Gabriel439 closed this Jun 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.