GithubHelp home page GithubHelp logo

Comments (6)

truizlop avatar truizlop commented on June 2, 2024 1

I think this is now ready to continue!

from bow.

ferranpujolcamins avatar ferranpujolcamins commented on June 2, 2024

Maybe also Traverse?

from bow.

truizlop avatar truizlop commented on June 2, 2024

Sounds good to me. Actually, I've needed Traverse on Trampoline more than a couple of times. Are you taking this as well?

from bow.

ferranpujolcamins avatar ferranpujolcamins commented on June 2, 2024

Yes! :)

from bow.

ferranpujolcamins avatar ferranpujolcamins commented on June 2, 2024

@truizlop

In order to add any typeclass instance to Trampoline we first need to add support for the higher kinded types simulation. Since this forces Trampoline to be a final class, the current enum case as a subclass approach won't work. We need to change to a wrapped enum approach as done in Free.

For the cases Done and Defer, the change is straightforward. For FlatMap no so much, because the subclassing mechanism was used to hide its type parameter A.

My proposed solution is to use Coyoneda. If you have closer look you'll see that FlatMap has the same data than Coyoneda<ForTrampoline, Trampoline<B>>, but Coyoneda hides the A parameter for us.

Here (trampolineTypeclasses branch) I implemented this approach successfully. However, the branch is based on #623 since I prefer the way Coyoneda is handled there (with polymorphic functions instead of casts). If that PR is finally not approved in a short time, I will of course rewrite the branch to work with the current Coyoneda implementation, I'm not trying to put pressure on you to approve the other PR.

Until we decide on which approach to follow, I'll keep this on hold.

from bow.

truizlop avatar truizlop commented on June 2, 2024

Closed by #636

from bow.

Related Issues (20)

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.