Comments (2)
@Profpatsch: This is intentional, although there is room for improvement
The rationale is that dhallToNix "f a"
should always produce the same result as dhallToNix "f" (dhallToNix "a")
For example:
dhallToNix "List/head" (dhallToNix "Natural") (dhallToNix "[ 1 ]")
= (_: xs: if xs == [] then null else builtins.head xs) {} [ 1 ]
= (xs: if xs == [] then null else builtins.head xs) [ 1 ]
= 1
= dhallToNix "List/head Natural [ 1 ]"
The reason that I say that there is more room for improvement is that we could actually use a more sophisticated representation for types (i.e. anything other than {}
). For example, a type like { foo : Natural, bar : Bool }
could be translated to Nix as something like { foo = "Natural"; bar = "Bool"; }
(or something similar). The only reason I didn't do that is that I couldn't find a use for it in the translation to Nix and I was lazy.
from dhall-nix.
I'm closing this out since I'm archiving the repository and I believe this was answered. For any additional questions, open up an issue against the repository's new home here: https://github.com/dhall-lang/dhall-haskell/issues
from dhall-nix.
Related Issues (10)
- Could lib.recursiveUpdate be used for (∧)? HOT 1
- Get dhall-nix on stackage HOT 3
- Nix daemon out of memory error HOT 4
- `hnix-0.5.2` incompatible with `dhall-1.18.0` HOT 4
- Update to newest dhall (& hnix) HOT 1
- Using relative path to a "type" file in dhallToNix HOT 5
- Instantiating example fails HOT 2
- Dhall types for higher-level nix concepts? HOT 3
- Package currently broken on nixpkgs-unstable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhall-nix.