Comments (4)
hmm.. would need to decide what the error should be. the example shown doesn't seem fatally problematic, in that even if someone believed X gets bound by the let, it would still have the same result. but if the type had another constructor say Y of the same type, then it would be more confusing. in principle though in such cases would have refutable pattern errors, assuming it's possible to do refutability for arrow typed things
from hazel.
probably just an arity error for constructors in patterns would do it?
from hazel.
It's probably more problematic in a case statement:
An arity error would probably do it; we just need to pass some sort of "expected arity" through pattern statics
from hazel.
not sure we need any more information. we know constructor arities from types in ctx. so:
- for pattern ap statics, check if fun pos is constructor with arrow type. inline its statics (ie dont recurse on funpos)
- for pattern constructor statics, it must be non arrow type (since we know we didnt pass thru ap)
from hazel.
Related Issues (20)
- IDE mode
- Linter
- Integrate live values into editor UI
- Code tour support
- Convert some Project Euler problems into Hazel exercises
- Line numbering
- Variable renaming UI
- Structured search
- Drag-and-drop blocks editing UI for Hazel
- cannot delete `=` when let type annotation trails with a hole HOT 1
- 1 @ 2 doesn't throw an error HOT 2
- Fixpoints in SynFun position create static errors HOT 2
- Structural copy/paste
- Relative precedence of ; and && HOT 1
- Add ability to decide on stepping strategy during stepping
- Think about how to update the stepper state when elaboration changes
- Make undo return you to previous stepper state HOT 1
- case checker on recursive types
- ADTs with hole type consistency have casting bug HOT 1
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 hazel.