Giter VIP home page Giter VIP logo

Comments (4)

lostintime avatar lostintime commented on May 27, 2024

@OliverJAsh which class mapN are missing from? Those are still present at least for IO and Future (v7.0.1), dunno about others, didn't use them

UPD: Sorry, I confused mapN with map1 - map6

from funfix.

lostintime avatar lostintime commented on May 27, 2024

It's probably the Option (v6.2.2: https://github.com/funfix/funfix/blob/v6.2.2/packages/funfix-core/src/disjunctions.ts#L652)

from funfix.

alexandru avatar alexandru commented on May 27, 2024

I removed mapN because it's non-standard and it was less useful than I thought it is.

Option also has filter on it, so you can do ... option.filter(_ != null) and I find this one more intuitive.

If you have a good use case for it, I'm willing to add it back.

from funfix.

alexandru avatar alexandru commented on May 27, 2024

Actually the use-case would be the one in the sample:

Option.of(user)
  .mapN(_ => _.contacts)
  .mapN(_ => _.length)

But in this case I kind of used Try instead, so Try.of(() => user.contacts.length).

So you know, if you liked mapN, copy/paste it from 6.2.2 and make a PR to re-add it.

from funfix.

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.