Skip to content

Implement for all immutablejs types #16

Open

Description

@goodmind

If all immutablejs types are extended from Collection can't we just patch it with fantasy-land methods?

Activity

  1. DrBoolean commented on Jun 22, 2018

    @DrBoolean
    Owner

    That's a good idea for aliases, but i'd think the implementation differs for most datatypes. In any case, a cool thing to try!

  2. StevenLangbroek commented on Feb 10, 2019

    @StevenLangbroek

    I'm not sure what you're suggesting is a good idea. @DrBoolean is obviously right that the semantics differ per class. I think you can find good literature that centralizing logic that should be decentralized leads to all sorts of antipatterns (the least of which is having a single union that handles all cases). It'll become the highest traffic file in this repo and, unless you want a couple hundred line file, will still have to delegate to modules per class, making it something akin to a leaky abstraction...

    edit: dig a little deeper before commenting Steven 😞. So this repo lives in a single file, so that concern isn't relevant (not until the repo grows a lot anyway). That being said, that union or switch or whatever structure you use for the logic would still live in Collection.prototype.<methodName>, which would still be a code smell.

    I'd still like to contribute, I could whip up a table of structures, the algebrae they implement, some notes so that people can pick them for contribution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions