GithubHelp home page GithubHelp logo

Comments (4)

et1975 avatar et1975 commented on August 30, 2024 1

There's nothing "impure" about partial application, the only reason we have arg separately is because we want a function, not a value passed as init.
Unfortunately I don't see a way to pass an extra argument unless it's a unit w/o breaking too much, and passing a unit will result in ugly init like unit->Route->'model*Cmd<'msg> for everyone who doesn't need to pass an additional arg.

from browser.

et1975 avatar et1975 commented on August 30, 2024

You can curry your argument in: Program.mkProgram (init your_arg) update view, but I'll see if we can do what you ask w/o breaking existing code.

from browser.

toburger avatar toburger commented on August 30, 2024

Hmm, I can live with your solution!
Only concern it is kind of an impure application in the elmish workflow, but a good enough workaround.

from browser.

toburger avatar toburger commented on August 30, 2024

No problem! Partial application is perfectly okay!
What I meant is that the argument isn't provided at the last possible point in time before the elmish engine kicks in... But that's negligible.. ;)

from browser.

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.