Comments (4)
Really we want a way to generically traverse over Stream
in our recursive datatypes. Unfortunately, because our datatypes are mutually recursive, I think the recursion schemes approach becomes substantially more complex. Not that I've necessarily fully wrapped my head around ordinary recursion schemes. 🙈
Lenses are something else to look at. If we go this route we should probably prefer optics
over lens
.
from intlc.
This came up again in linting for getStream
. It's traversal more generally that's a challenge.
from intlc.
Came up again in mapTokens
which could at least reuse some of the stuff defined for flattening.
from intlc.
For better linting output we need to retain source span information
in the AST (#142). A naive implementation might look like this:
type Stream = [(Token, SourceSpan)]
This makes for a relatively small lib/
diff, and all else looks rosy until we contemplate how we write tests. Where now we might write Plaintext "foo"
, we'd now need to provide source information. And we'd have to do this everywhere in our tests, and it'd be nonsense that we never use anyway.
A similar problem presents when flattening. It's a lossless procedure in which any source information should be thrown away as it's really no longer valid.
This makes the idea of making our AST parameterised, recursion schemes or not, very tempting. In that scenario our tests can continue to target [Token]
, but our parser output and linting input could be [(Token, SourceSpan)]
. Flattening would transform the latter to the former.
Edit: This describes what I want to do: https://www.reddit.com/r/haskell/comments/sxsj4m/what_are_strategies_for_tracking_type_checking/hxu2tsj/
from intlc.
Related Issues (20)
- CI formatting step broken HOT 2
- Formatter
- Reuse lint/parser infra for invalid keys error printing HOT 1
- Autofixable lints
- React codegen without JSX
- Add a changelog HOT 1
- Deprecated CI actions in publish workflow HOT 1
- Flattening broken HOT 2
- Language server
- Syntax highlighting in editors HOT 1
- Combine transformations HOT 3
- Produce binaries for more OS/arch pairs HOT 3
- `intlc prettify` isn't working HOT 1
- Deduplicate exec entrypoints
- Specify formatting
- Group linting "learn more" links to the end
- Lint rule enforcing descriptions
- Flattening doesn't traverse callbacks
- asdf plugin HOT 1
- Widen JSX callback type
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 intlc.