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

convert nix file to haskell json object. #539

Open
clojurians-org opened this issue Mar 18, 2020 · 3 comments
Open

convert nix file to haskell json object. #539

clojurians-org opened this issue Mar 18, 2020 · 3 comments

Comments

@clojurians-org
Copy link

i have a nix file as haskell config file, i want to convert it to json.

this is the step i plan to do:

N.parseNixFile
N.runWithBasicEffects
  N.nixEvalExpr
  N.nvalueToJSONNixString

but i have no method to convert NixString to haskell object now.

@Anton-Latukha
Copy link
Collaborator

Anton-Latukha commented Apr 10, 2020

"Chaser, No Straight" (Thelonious Monk reference (I elaborate on the question))

You directly encountered that string handling in HNix is one of the rougher areas that require further forming into a good shape. String.hs explicitly calls for work and there are a number of hacky functions that need to be replaced & because of that situation I needed to implement one myself for handling them.

In Nix language, there is no such type as char, so list can not assemble a sting from them, so string itself is primitive type in the language.

Issue you referring to probably relates also to #534: main type building blocks need to be enumerated in NAtom, but NixString is not represented there and NixString handling structure is not fully formed and needs to be integrated.

@Anton-Latukha
Copy link
Collaborator

Maybe by "haskell json object" meant: "haskell json object" file (I do not know of such)

Currently we rolled back on JSON progress, (as remember) due to some instance implementation complications. But export to JSON is of course needed.

@Anton-Latukha
Copy link
Collaborator

I still do not understand what is meant by: JSON object.

Is it: https://docs.oracle.com/javaee/7/api/javax/json/JsonObject.html


Most of To/FromJSON instances for NExprF/NExpr are there.

There is probably a 1-2 push to make NExpr convert.

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

No branches or pull requests

2 participants