Coder Social home page Coder Social logo

Comments (3)

Gabriella439 avatar Gabriella439 commented on June 11, 2024 1

Yes, I agree that Dhall's parser should be encodable as an LALR grammar. This is actually how I originally wrote Dhall before I switched to using trifecta (which provides better support for error messages, but is an unrestricted parser combinator library).

For the inconsistent treatment of type annotation under lambda abstraction, the correct behavior should be that the type annotation binds tighter than the lambda abstraction, meaning that this:

\(x : Natural) -> x : Natural

... should be equivalent to this:

\(x : Natural) -> (x : Natural)

Like you mentioned, this would then make them consistent with Haskell, where the type annotation also binds tighter than lambda abstraction:

>>> :type (\x -> x :: Int)
(\x -> x :: Int) :: Int -> Int

I'll make the required change soon to this repository

Also, thanks for porting Dhall to Rust! :)

from dhall-haskell.

Gabriella439 avatar Gabriella439 commented on June 11, 2024

I have a pull request out for this here: #30

If you have time could you take a look at that and see if it introduces any new shift-reduce or reduce-reduce conflicts?

from dhall-haskell.

nanotech avatar nanotech commented on June 11, 2024

That solves it. Doing a one-to-one translation still produces a shift/reduce error between the two '[' Elements ']' rules, but as the ':' rules are at the same precedence now, that's easy to work around by replacing the '[' Elements ']' ':' ListLike ExprE rule with some post-parse pattern matching in the ExprC ':' ExprA rule as I tried to do previously.

Thanks!

from dhall-haskell.

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.