GithubHelp home page GithubHelp logo

matzko / elm-opaque-dict Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 185 KB

An opaque dictionary for Elm

Home Page: https://package.elm-lang.org/packages/matzko/elm-opaque-dict/latest

License: MIT License

JavaScript 0.92% Elm 99.08%

elm-opaque-dict's People

Contributors

martinsstewart avatar matzko avatar

Watchers

 avatar

Forkers

martinsstewart

elm-opaque-dict's Issues

`update` gives a different result than `elm/core`

> import Dict
> let a = Dict.singleton 0 0 in Dict.update 0 (\_ -> Nothing) a
Dict.fromList [] : Dict.Dict number number1
> let a = Dict.singleton 0 0 in Dict.update 0 (\_ -> Nothing) a
Dict.fromList [] : Dict.Dict number number1

When using update, mapping to Nothing means to remove the element, whereas in this package it leaves it untouched.

Fixing this would be a breaking change because it changes the behavior, but not a breaking API change.

I see three approaches:

  1. document the difference
  2. fix the implementation (from withDefault ... >> Tuple.pair ... >> Just to Maybe.map (Tuple.pair ...)), put a warning somewhere, hope users read it
  3. add a dummy export, publish a minor version, then fix as above while removing the dummy export to force a major version (this still requires a warning but should avoid surprises, users are supposed to check what a major version bump entails

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.