purescript-web / purescript-web-geometry

MIT License
5 stars 0 forks source link

`item` function should return a Maybe #3

Open MonaMayrhofer opened 8 months ago

MonaMayrhofer commented 8 months ago

Is there a reason that the item function does not return Maybe DOMRect?

https://github.com/purescript-web/purescript-web-geometry/blob/54991647c5a8108c65f52e749c5ecc31ef69f6db/src/Web/Geometry/DOMRectList.purs#L8-L8

As far as I can tell, the javascript is just a regular indexing into a collection, which may or may not return null, which should definitely be represented in the type system.

keijokapp commented 8 months ago

I think you are right. It seems to be an oversight. I would fix it but I don't know what are the best practises to make these kinds of type changes in purescript[-web] ecosystem because if would break any other code depending on this declaration.

MonaMayrhofer commented 8 months ago

I have no experience with the procedures either, this is definitely a breaking change, so a major version change is the least that should happen... I dont know what the common practices to reduce churn in the ecosystem are tho.

From what i can tell e.g from a quick look at the canvas package within org there dont seem to be any other things to do?

I guess the folks over at the discord might have some insights?