Git Product home page Git Product logo

Comments (3)

TheAngryByrd avatar TheAngryByrd commented on May 28, 2024

👋 Yeah some names aren't straight forward and are chosen because of their resemblance to their list counterparts.

Additionally filter even with collections provides confusion, as what indeed it does is filtering OUT item(s)

Actually filter does filter, but it filters for the predicate value. Think of it like filtering for the thing you want. A coffee filter, filters for coffee (the liquid) and filters out anything else (the grounds).

Personally I find filter weird also and would prefer filterFor and filterOut. Would be more clear when coffee filtering what you're looking for. (filterFor (fun x -> x.IsLiquid)/filterOut(fun x -> x.AreGrounds)


That being said, I won't remove filter as that kind of breaking change is not worth it. Also, Option.filter is already part are F# core, so this really wouldn't be solved here. You're still going to need your own alias module without this library.

As far as an alias, where does pop up and people familiar with LINQ/SQL would be more comfortable. I would be open to a PR adding where in addition all the places filter current exists.

from fstoolkit.errorhandling.

PawelStadnicki avatar PawelStadnicki commented on May 28, 2024

Thank you for a very good clarification. I agree with all of that, and indeed Option.where seems to be a better alternative. These filterFor, filterOut also sound interesting. Let me play with it in the project and then I will prepare a PR.

from fstoolkit.errorhandling.

bartelink avatar bartelink commented on May 28, 2024

TaskSeq has a where for every filter, aligning with FSharp's general stance (even though for me it's a bit of a wart, and not an overall positive to have filter and where being identical given such redundant aliases are not present in anything else in F#)

Though the coffee rationale finally gives me a way to make peace with the filter functions name, thanks!

from fstoolkit.errorhandling.

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.