free-theorems's People
Forkers
alexfmpefree-theorems's Issues
Un-reduced type constructor variables
While a -> a
and (a -> b) -> [a] -> [b]
have their relation variables reduced into functions, that's not the case for (forall x. a x -> a x)
and (a -> b) -> f a -> f b
, so we don't end up without a equal/inequal theorem.
The problem is that unfoldFormula
simply returns return . Predicate . IsMember x y $ rel
for RelConsFunVar
(with #3) and RelTypeConsApp
. I'm not sufficiently familiar with free theorem derivation to know what they should return instead though.
Use type application syntax
Currently, it prints type instantiations like this:
forall t1,t2 in TYPES, R in REL(t1,t2).
forall p :: t1 -> Bool.
forall q :: t2 -> Bool.
(forall (x, y) in R. p x = q y)
==> (forall (z, v) in lift{[]}(R).
(f_{t1} p z, f_{t2} q v) in lift{[]}(R))
but these days, Haskell has “Proper” syntax for this:
forall t1,t2 in TYPES, R in REL(t1,t2).
forall p :: t1 -> Bool.
forall q :: t2 -> Bool.
(forall (x, y) in R. p x = q y)
==> (forall (z, v) in lift{[]}(R).
(f @t1 p z, f @t2 q v) in lift{[]}(R))
and I think this library should use it.
Free theorems modernization roadmap
- Building with newer GHC: #2
- Exposing support for higher-ranked types: #3
- Handling incomplete pattern matches
- New hackage release
- Potentially upstream into ghci
There's 30-40 incomplete patterns laying around. For some of them it's obvious what to do, but in general I've been mostly doing throwError
or documenting with error
, depending on what's already there. Hardly ideal but still better than Non-exhaustive patterns in function foo
, which is what we currently get for (intentionally or not) unsupported operations.
I wanted to port just #3 to @nomeata's version to get one last useful/releasable step before the big merge/jump, but it required also porting the work getting haskell-src-exts
to build for newer ghc, so meh.
I do wonder if it makes sense for free-theorems
to keep living as a standalone thing that has its own mini haskell AST types in addition to the ones in haskell-src-exts
(which is now in life support). Would it be more at home in ghci
under :i
or so? Maybe it could be a google summer of code or haskell foundation project.
After all, the compiler already has everything in scope, and squeezing every bit of reasoning based on types alone is textbook haskell. I'm not sure if the theorems could also be useful for automatically obtaining rewrite rules or if that always needs human curation.
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.