Comments (3)
I like this design! I think it's possible to keep the conversions pretty ergonomic across encodings; it gets more tricky when different list types are involved. Consider the following cases:
1.to_church()
1.to_scott()
Some(1).to_church()
Some(1).to_scott() //same as above except for the numeral
vec![1, 2, 3].to_church()
vec![1, 2, 3].to_scott() //same as above except for the numeral
Some(false).to_church()
Some(false).to_scott() //same as above
All of this seems possible with the design you outlined (there will be a little duplication of impl Trait
s for each of the encoding traits to make this work, but that doesn't seem too bad). However, I'm not sure how to make this design work when there are also different types of e.g. lists that are shared across encodings.
(I'll be away for the next 3 days, so I may not respond to this thread right away!)
from lambda_calculus.
That was actually much easier than I expected. I currently finished refactoring with a single list; it looks pretty good, so I'll merge it.
from lambda_calculus.
After some consideration I decided against adding different representations of lists; it could easily become a mess and the current one is the one most widely used and imo practical.
from lambda_calculus.
Related Issues (7)
- Some CallByValue and HybridApplicative β-reductions with the Z combinator end up in an endless loop HOT 1
- 2.0.0 API changes HOT 11
- Not all list 2.0 function doctests are compatible with all numeral encodings HOT 7
- Make PRETTY_LAMBDA changeable outside the crate HOT 3
- Succ and pred in Mogensen's binary encoding fail HOT 1
- Unable to replicate the paper Fontana and Buss 1994 (https://link.springer.com/content/pdf/10.1007/BF02458289.pdf) HOT 5
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 lambda_calculus.