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

json-to-dhall initial implementation #884

Merged
merged 13 commits into from
Apr 14, 2019
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dhall-json/dhall-json.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,29 @@ Executable dhall-to-yaml
text
GHC-Options: -Wall

Executable json-to-dhall
Hs-Source-Dirs: json-to-dhall
Main-Is: Main.hs
Build-Depends:
base ,
aeson ,
aeson-pretty < 0.9 ,
bytestring < 0.11 ,
dhall ,
optparse-applicative ,
text < 1.3 ,
scientific >= 0.3.0.0 && < 0.4 ,
exceptions >= 0.8.3 && < 0.11 ,
containers ,
unordered-containers >= 0.1.3.0 && < 0.3
if !impl(ghc >= 8.0) && !impl(eta >= 0.8.4)
Build-Depends: semigroups == 0.18.*
Other-Modules:
Paths_dhall_json
GHC-Options: -Wall
if impl(ghc < 8.0)
Buildable: False

Test-Suite tasty
Type: exitcode-stdio-1.0
Hs-Source-Dirs: tasty
Expand Down
13 changes: 13 additions & 0 deletions dhall-json/examples/bower.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Using this file:
-- json-to-dhall ./bower.dhall < ./bower.json | dhall
-- Round-trip test:
-- json-to-dhall ./bower.dhall < ./bower.json | dhall | dhall-to-json

{ name : Text
, description : Text
, license : Text
, keywords : List Text
, repository : { type : Text, url : Text}
, dependencies : List { mapKey: Text, mapValue: Text }
, devDependencies : List { mapKey: Text, mapValue: Text }
}
20 changes: 20 additions & 0 deletions dhall-json/examples/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "purescript-package",
"description": "A simple PS package",
"keywords": [
"purescript"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/purescript/purescript-package.git"
},
"dependencies": {
"purescript-prelude": "^4.0.0",
"purescript-effect": "^2.0.0"
},
"devDependencies": {
"purescript-math": "^2.1.1",
"purescript-integers": "^4.0.0"
}
}
Loading