Giter Site home page Giter Site logo

Encodings 2.0 about lambda_calculus HOT 3 CLOSED

ljedrz avatar ljedrz commented on May 31, 2024 1
Encodings 2.0

from lambda_calculus.

Comments (3)

billpmurphy avatar billpmurphy commented on May 31, 2024

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 Traits 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.

ljedrz avatar ljedrz commented on May 31, 2024

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.

ljedrz avatar ljedrz commented on May 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.