Giter Site home page Giter Site logo

Comments (6)

Gabriella439 avatar Gabriella439 commented on June 25, 2024

I believe Dhall's parser used to support this in older versions but doesn't any longer once I standardized the grammar. Like you noticed, List/map is a valid parse for List applied to the file /map and that parse takes priority over parsing it as a single variable name. In fact, I think some examples in the tutorial use this idiom and they need to be fixed

Normally you would fix this using a lexer with a longest-match rule, but the Dhall language cannot support a separate lexing step because some language features fundamentally conflict with lexing (specifically: nested block comments and string interpolation).

You can work around this by just prefixing the variable name with anything like Prelude/List/map, or just calling it map

from dhall-lang.

purcell-nec avatar purcell-nec commented on June 25, 2024

Ah, thanks - that works. I was going off the examples at https://hackage.haskell.org/package/dhall-1.8.0/docs/Dhall-Tutorial.html#g:20, fyi.

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on June 25, 2024

I'll reopen this just to remind myself to fix the tutorial examples

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on June 25, 2024

Fixed by dhall-lang/dhall-haskell@834c1b6

from dhall-lang.

Gabriella439 avatar Gabriella439 commented on June 25, 2024

It turns out that there might be a way to fix the original issue after all to support identifier names like List/map. See: #83

from dhall-lang.

purcell-nec avatar purcell-nec commented on June 25, 2024

Nice!

from dhall-lang.

Related Issues (20)

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.