Comments (3)
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.
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.
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)
- Failure to Decode Expression with extended Builtin Function HOT 1
- Document the significance of `Nothing :: Maybe CharacterSet`
- Please report symlink contents for `Error: Missing file` HOT 2
- Error generating docs
- combine `let` bindings in `dhall format` HOT 1
- Support request for `aeson` 2.2 in `dhall` HOT 2
- dhall-to-yaml does not properly quote strings HOT 1
- Can not install dhall-lsp-server HOT 2
- Allow hnix 0.17
- Hackage build failed for dhall-toml-1.0.3
- Get back into Stackage Nightly with GHC 9.8 HOT 1
- Missing binaries in release HOT 1
- Hackage release for dhall-lsp-server HOT 1
- Build failure on GHC 9.8.1: 'Illegal invisible type variable binder'
- Report imports HOT 1
- dhall-docs: Prelude.head: empty list
- Suggesting a new construct for dealing with optional fields in Dhall defaults
- dhall-json bound on aeson can be relaxed
- Questions regarding the right strategy for upgrading to ghc-9.8
- Build failure on macos-latest stack.yaml HOT 3
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-haskell.