Giter Club home page Giter Club logo

Comments (2)

Gabriella439 avatar Gabriella439 commented on June 9, 2024 1

@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.

Gabriella439 avatar Gabriella439 commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.